problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02695 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int save[1050][20];
int now[20];
int n, m, Q, tot;
void dfs(int index, int p) {
if (index == n) {
for (int i = 0; ... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int save[100000][20];
int now[20];
int n, m, Q, tot;
void dfs(int index, int p) {
if (index == n) {
for (int i = 0... | replace | 11 | 12 | 11 | 12 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define SZ(a) int((a).size())
#define _REP(_1, _2, _3, _4, name, ...) name
#define _REP4(i, b, e, s) \
for (decltype(e) _b = (b), _e = (e), i = _b + (0 < (s) ? 0 : (s)); \
(0 < (s) ? i < _e : _e <= i);... | #include <bits/stdc++.h>
using namespace std;
#define SZ(a) int((a).size())
#define _REP(_1, _2, _3, _4, name, ...) name
#define _REP4(i, b, e, s) \
for (decltype(e) _b = (b), _e = (e), i = _b + (0 < (s) ? 0 : (s)); \
(0 < (s) ? i < _e : _e <= i);... | replace | 64 | 65 | 64 | 65 | -6 | free(): invalid pointer
|
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#define LL long long
#define rep(i, a, b) for (int i = a; i <= b; ++i)
using namespace std;
const int mn = 17;
int a[mn], b[mn], c[mn], d[mn], v[mn] = {1};
int n, m, q, ans;
void dfs(int x) {
if (x == n + 1) {
int sum = 0;
for (int i = 1; i <= q; ++i) {
if (v[b[i]] - v[a[i]] =... | #include <bits/stdc++.h>
#define LL long long
#define rep(i, a, b) for (int i = a; i <= b; ++i)
using namespace std;
const int mn = 57;
int a[mn], b[mn], c[mn], d[mn], v[mn] = {1};
int n, m, q, ans;
void dfs(int x) {
if (x == n + 1) {
int sum = 0;
for (int i = 1; i <= q; ++i) {
if (v[b[i]] - v[a[i]] =... | replace | 5 | 6 | 5 | 6 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 10 + 5;
int a[maxn], b[maxn], c[maxn], d[maxn];
int n, m, Q;
int ans = 0;
int res[maxn];
void dfs(int step, int last) {
if (step == n + 1) {
int cost = 0;
for (int i = 1; i <= Q; i++) {
if (res[b[i]] - res[a[i]] == c[i])... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 50 + 5;
int a[maxn], b[maxn], c[maxn], d[maxn];
int n, m, Q;
int ans = 0;
int res[maxn];
void dfs(int step, int last) {
if (step == n + 1) {
int cost = 0;
for (int i = 1; i <= Q; i++) {
if (res[b[i]] - res[a[i]] == c[i])... | replace | 3 | 4 | 3 | 4 | 0 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#defin... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#defin... | replace | 25 | 27 | 25 | 27 | 0 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
typedef char SINT8;
typedef short SINT16;
typedef int SINT32;
typedef long long SINT64;
typedef double DOUBLE;
#define MAX(a, b) ((a) > (b) ? ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
typedef char SINT8;
typedef short SINT16;
typedef int SINT32;
typedef long long SINT64;
typedef double DOUBLE;
#define MAX(a, b) ((a) > (b) ? ... | replace | 49 | 50 | 49 | 50 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 20;
int a[N], b[N], c[N], d[N], p[N];
int ans = 0;
int n, m, q;
void dfs(int x) {
int cnt = 0, i;
if (x == n + 1) {
for (i = 1; i <= q; i++)
if (p[b[i]] - p[a[i]] == c[i])
cnt += d[i];
ans = max(cnt, ans);
return;
}
for (p[x] ... | #include <bits/stdc++.h>
using namespace std;
const int N = 100;
int a[N], b[N], c[N], d[N], p[N];
int ans = 0;
int n, m, q;
void dfs(int x) {
int cnt = 0, i;
if (x == n + 1) {
for (i = 1; i <= q; i++)
if (p[b[i]] - p[a[i]] == c[i])
cnt += d[i];
ans = max(cnt, ans);
return;
}
for (p[x]... | replace | 2 | 3 | 2 | 3 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll N, M, Q;
vector<ll> A(10, 0), B(10, 0), C(10, 0), D(10, 0);
ll ans = 0;
ll dfs(vector<ll> V, int index) {
vector<ll> V2 = V;
ll ret = 0;
if (index < N - 1) {
for (ll i = V[index]; i <= M; i++) {
V2[index + 1] = i;
ret = max(r... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll N, M, Q;
vector<ll> A(50, 0), B(50, 0), C(50, 0), D(50, 0);
ll ans = 0;
ll dfs(vector<ll> V, int index) {
vector<ll> V2 = V;
ll ret = 0;
if (index < N - 1) {
for (ll i = V[index]; i <= M; i++) {
V2[index + 1] = i;
ret = max(r... | replace | 5 | 6 | 5 | 6 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
namespace variables {
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
struct triple {
ll first, second, third;
};
} // namespace variables
using namespace variables;
void testt();
namesp... | #include <bits/stdc++.h>
using namespace std;
namespace variables {
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
struct triple {
ll first, second, third;
};
} // namespace variables
using namespace variables;
void testt();
namesp... | replace | 258 | 259 | 258 | 259 | 0 | |
p02695 | C++ | Runtime Error | #pragma region RegionDefs
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, l, r) for (int i = (l), i##_len = (r); i < i##_len; ++i)
#define all(x) begin(x), end(x)
using namespace std;
const int INF = 1e9;
template <class T = int> using V = vector<T>;
template ... | #pragma region RegionDefs
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, l, r) for (int i = (l), i##_len = (r); i < i##_len; ++i)
#define all(x) begin(x), end(x)
using namespace std;
const int INF = 1e9;
template <class T = int> using V = vector<T>;
template ... | replace | 75 | 76 | 75 | 76 | 0 | |
p02695 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
// #include <limits>
// #include <type_traits>
// #include <boost/integer/common_factor_rt.hpp>
using namespace std;
int main() {
long ans, sum;
int i, j, N, M, Q;
int a[50], b[50], c[50];
long d[5... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
// #include <limits>
// #include <type_traits>
// #include <boost/integer/common_factor_rt.hpp>
using namespace std;
int main() {
long ans, sum;
int i, j, N, M, Q;
int a[50], b[50], c[50];
long d[5... | replace | 51 | 52 | 51 | 52 | TLE | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int a[50], b[50], c[50], d[50];
int n, m, q;
int ans = 0;
int A[10];
void dfs(int dep, int pre) {
if (dep == n) {
int sum = 0;
for (int i = 0; i < q; i++) {
if (A[b[i] - 1] - A[a[i] - 1] == c[i])
sum += d[i];
}
ans = max(sum, ans);
ret... | #include <bits/stdc++.h>
using namespace std;
int a[50], b[50], c[50], d[50];
int n, m, q;
int ans = 0;
int A[10];
void dfs(int dep, int pre) {
if (dep == n) {
int sum = 0;
for (int i = 0; i < q; i++) {
if (A[b[i] - 1] - A[a[i] - 1] == c[i])
sum += d[i];
}
ans = max(sum, ans);
ret... | replace | 20 | 23 | 20 | 23 | -11 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool nextvect(vector<int> &A, int N, int M) {
if (A[N - 1] < M)
A[N - 1]++;
else {
int i = N - 2;
while (i >= 0 && A[i] == M)
i--;
if (i == -1)
return false;
A[i]++;
for (int j = i + 1; j < N; j++)
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool nextvect(vector<int> &A, int N, int M) {
if (A[N - 1] < M)
A[N - 1]++;
else {
int i = N - 2;
while (i >= 0 && A[i] == M)
i--;
if (i == -1)
return false;
A[i]++;
for (int j = i + 1; j < N; j++)
... | insert | 18 | 18 | 18 | 19 | 0 | |
p02695 | C++ | Time Limit Exceeded | #define _GLIBCXX_DEBUG
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using pss = pair<string, string>;
using pcc = pair<char, char>;
using pbb = pair<bool, bool>;
using pil = pair<int,... | #define _GLIBCXX_DEBUG
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using pss = pair<string, string>;
using pcc = pair<char, char>;
using pbb = pair<bool, bool>;
using pil = pair<int,... | replace | 310 | 312 | 310 | 311 | TLE | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
using namespace __gnu_pbds;
#define fastio \
ios_base::sync_with_stdio(0); ... | #include <bits/stdc++.h>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
using namespace __gnu_pbds;
#define fastio \
ios_base::sync_with_stdio(0); ... | replace | 55 | 56 | 55 | 56 | 0 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define MOD 1000000007
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i, n) for (int i = 0, i##_len = (n); i... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define MOD 1000000007
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i, n) for (int i = 0, i##_len = (n); i... | replace | 32 | 33 | 32 | 33 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef struct QRY {
int a;
int b;
int c;
int d;
} qry_t;
int main(void) {
int N, M, Q;
cin >> N >> M >> Q;
vector<qry_t> qry(Q);
for (int i = 0; i < Q; ++i) {
cin >> qry.at(i).a >> qry.at(i).b >> qry.at(i).c >> qry.at(i).d;
}
vector<vector<int>>... | #include <bits/stdc++.h>
using namespace std;
typedef struct QRY {
int a;
int b;
int c;
int d;
} qry_t;
int main(void) {
int N, M, Q;
cin >> N >> M >> Q;
vector<qry_t> qry(Q);
for (int i = 0; i < Q; ++i) {
cin >> qry.at(i).a >> qry.at(i).b >> qry.at(i).c >> qry.at(i).d;
}
vector<vector<int>>... | replace | 19 | 20 | 19 | 20 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct info {
int a, b, c, d;
};
int main() {
int n, m, q;
cin >> n >> m >> q;
vector<info> v(n);
for (int i = 0; i < q; i++) {
info in;
cin >> in.a >> in.b >> in.c >> in.d;
v[i] = in;
}
queue<vector<int>> que;
que.push({1});
int cur_mx = 0;
... | #include <bits/stdc++.h>
using namespace std;
struct info {
int a, b, c, d;
};
int main() {
int n, m, q;
cin >> n >> m >> q;
vector<info> v(q);
for (int i = 0; i < q; i++) {
info in;
cin >> in.a >> in.b >> in.c >> in.d;
v[i] = in;
}
queue<vector<int>> que;
que.push({1});
int cur_mx = 0;
... | replace | 10 | 11 | 10 | 11 | 0 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
#define intmax INT... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
#define intmax INT... | replace | 171 | 173 | 171 | 173 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, Q;
cin >> N >> M >> Q;
vector<int> a(Q);
vector<int> b(Q);
vector<int> c(Q);
vector<int> d(Q);
for (int i = 0; i < Q; i++) {
cin >> a.at(i) >> b.at(i) >> c.at(i) >> d.at(i);
}
int ans = 0;
int hozonnum = 0;
if (Q == 1) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, Q;
cin >> N >> M >> Q;
vector<int> a(Q);
vector<int> b(Q);
vector<int> c(Q);
vector<int> d(Q);
for (int i = 0; i < Q; i++) {
cin >> a.at(i) >> b.at(i) >> c.at(i) >> d.at(i);
}
int ans = 0;
int hozonnum = 0;
if (Q == 1) {
... | replace | 150 | 151 | 150 | 151 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a) = max(a, b)
#define chmin(a, b) (a) = min(a, b)
#define moC(a, s, b) (a) = ((a)s(b) + MOD) % MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll ... | #include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a) = max(a, b)
#define chmin(a, b) (a) = min(a, b)
#define moC(a, s, b) (a) = ((a)s(b) + MOD) % MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll ... | replace | 26 | 27 | 26 | 27 | 0 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int n, m, q;
vector<vector<unordered_map<int, int>>> v;
void dfs(vector<int> &cur, int score, int &res) {
if ((int)cur.size() == n) {
res = max(res, score);
return;
}
int i = cur.empty() ? 1 : cur.b... | #include <algorithm>
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int n, m, q;
vector<vector<unordered_map<int, int>>> v;
void dfs(vector<int> &cur, int score, int &res) {
if ((int)cur.size() == n) {
res = max(res, score);
return;
}
int i = cur.empty() ? 1 : cur.b... | replace | 31 | 32 | 31 | 32 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
using ll = long long int;
using vi = vector<ll>;
ll n, m, k;
ll ans = 0... | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
using ll = long long int;
using vi = vector<ll>;
ll n, m, k;
ll ans = 0... | replace | 18 | 19 | 18 | 19 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
template <class T, class S> void cmin(T &a, ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;
template <class T, class S> void cmin(T &a, ... | replace | 18 | 19 | 18 | 19 | 0 | |
p02695 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int n, m, q;
int ans;
vector<int> a, b, c, d;
void dfs(vector<int> A) {
if (A.size() == n + 1) {
int now = 0;
rep(i, q) {
if (A[b[i]] - A[a[i]] == c[i])
now += d[i];
}
an... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
int n, m, q;
int ans;
vector<int> a, b, c, d;
void dfs(vector<int> A) {
if (A.size() == n + 1) {
int now = 0;
rep(i, q) {
if (A[b[i]] - A[a[i]] == c[i])
now += d[i];
}
an... | insert | 17 | 17 | 17 | 18 | TLE | |
p02695 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
int n, m, q;
vector<int> a, b, c, d;
int ans;
void dfs(vector<int> A) {
if (A.size() == n + 1) {
int now = 0;
for (int i = 0; i < q; i++) {
if (A[b[i]] - A[a[i]] == c[i])
now += d[i];
}
ans = max(ans, now);
}
A.push_back(A.b... | #include <iostream>
#include <vector>
using namespace std;
int n, m, q;
vector<int> a, b, c, d;
int ans;
void dfs(vector<int> A) {
if (A.size() == n + 1) {
int now = 0;
for (int i = 0; i < q; i++) {
if (A[b[i]] - A[a[i]] == c[i])
now += d[i];
}
ans = max(ans, now);
return;
}
A.p... | insert | 15 | 15 | 15 | 16 | TLE | |
p02695 | C++ | Runtime Error | #include <iostream>
using namespace std;
int a[10], b[10], c[10], d[10], e[10];
int n, m, q;
int ret = 0;
void dfs(int pos, int val) {
if (pos == n) {
int tmp = 0;
for (int i = 0; i < q; i++) {
tmp += d[i] * (e[b[i]] - e[a[i]] == c[i]);
}
ret = max(ret, tmp);
return;
}
for (int i = val... | #include <iostream>
using namespace std;
int a[50], b[50], c[50], d[50], e[50];
int n, m, q;
int ret = 0;
void dfs(int pos, int val) {
if (pos == n) {
int tmp = 0;
for (int i = 0; i < q; i++) {
tmp += d[i] * (e[b[i]] - e[a[i]] == c[i]);
}
ret = max(ret, tmp);
return;
}
for (int i = val... | replace | 3 | 4 | 3 | 4 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;
void prvec(vector<ll> vec) { // for debug
ll n = vec.size();
co... | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;
void prvec(vector<ll> vec) { // for debug
ll n = vec.size();
co... | replace | 32 | 33 | 32 | 33 | 0 | |
p02695 | C++ | Runtime Error | // #include <bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll, vLL;
type... | // #include <bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll, vLL;
type... | replace | 31 | 32 | 31 | 32 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int q, ans = 0;
vector<int> e;
vector<int> f;
struct matter {
int a, b, c, d;
};
matter p[50];
void check() {
int val = 0;
for (int i = 0; i < q; i++) {
if ((f[p[i].b - 1] - f[p[i].a - 1]) == p[i].c)
val = val + p[i].d;
}
ans = m... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int q, ans = 0;
vector<int> e;
vector<int> f;
struct matter {
int a, b, c, d;
};
matter p[50];
void check() {
int val = 0;
for (int i = 0; i < q; i++) {
if ((f[p[i].b - 1] - f[p[i].a - 1]) == p[i].c)
val = val + p[i].d;
}
ans = m... | replace | 26 | 27 | 26 | 27 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long int x[15], n, m, i, ans, a[15], b[15], c[15], d[15], q;
void bt(long long int p) {
long long int t, s;
if (p <= n) {
for (t = x[p - 1]; t < m + 1; t++) {
x[p] = t;
bt(p + 1);
}
return;
}
s = 0;
for (t = 1; t < q + 1; t++)
if... | #include <bits/stdc++.h>
using namespace std;
long long int x[15], n, m, i, ans, a[55], b[55], c[55], d[55], q;
void bt(long long int p) {
long long int t, s;
if (p <= n) {
for (t = x[p - 1]; t < m + 1; t++) {
x[p] = t;
bt(p + 1);
}
return;
}
s = 0;
for (t = 1; t < q + 1; t++)
if... | replace | 3 | 4 | 3 | 4 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define ll long long
#define umap unordered_map
using graph = vector<vector<int>>;
using graph2 = vector<vector<pair<int, int>>>;
ll mod(ll x, ll y) {
if (x >= 0 |... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define ll long long
#define umap unordered_map
using graph = vector<vector<int>>;
using graph2 = vector<vector<pair<int, int>>>;
ll mod(ll x, ll y) {
if (x >= 0 |... | replace | 37 | 38 | 37 | 38 | 0 | |
p02695 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define loop(i, a, n) for (ll i = a; i < n; i++)
#define loopm(i, a, n) for (ll i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define Graph(n) vector<vector<ll>>(n, vector<ll>(0, 0)... | #include <bits/stdc++.h>
using namespace std;
#define loop(i, a, n) for (ll i = a; i < n; i++)
#define loopm(i, a, n) for (ll i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define Graph(n) vector<vector<ll>>(n, vector<ll>(0, 0)... | replace | 25 | 26 | 25 | 26 | TLE | |
p02695 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
int *num_array;
int array_len;
int num_max;
int score_len;
vector<int> as;
vector<int> bs;
vector<int> cs;
vector<int> ds;
bool array_next(int index);
int main(void) {
cin >> array_len >> num_max >> score_len;
for (int i = 0; i < score_len; i++) {
... | #include <iostream>
#include <vector>
using namespace std;
int *num_array;
int array_len;
int num_max;
int score_len;
vector<int> as;
vector<int> bs;
vector<int> cs;
vector<int> ds;
bool array_next(int index);
int main(void) {
cin >> array_len >> num_max >> score_len;
for (int i = 0; i < score_len; i++) {
... | replace | 70 | 72 | 70 | 77 | TLE | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int getRand(int l, int r) {
uniform_int_distribution<int> uid(l, r);
return uid(rng);
}
#de... | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int getRand(int l, int r) {
uniform_int_distribution<int> uid(l, r);
return uid(rng);
}
#de... | replace | 45 | 46 | 45 | 46 | 0 | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll, vl /*, greater<ll>*/> pql; // 降順(/*昇順*/)
typedef set<ll> sl;
#define rep(i, n... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll, vl /*, greater<ll>*/> pql; // 降順(/*昇順*/)
typedef set<ll> sl;
#define rep(i, n... | insert | 46 | 46 | 46 | 52 | 0 | |
p02695 | C++ | Time Limit Exceeded | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <climits>
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // deque
#include <functional>
#incl... | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <climits>
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // deque
#include <functional>
#incl... | insert | 33 | 33 | 33 | 34 | TLE | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep2(x, fr, to) for (int x = (fr); x < (to); x++)
#define rep(x, to) for (int x = 0; x < (to); x++)
#define repr(x, fr, to) for (int x = (fr); x >= (to); x--)
#define all(c) c.begin(), c.end()
#define sz(v) (int)v.size()
using namespace std;
typedef long long ll;
typedef vector<int> V... | #include <bits/stdc++.h>
#define rep2(x, fr, to) for (int x = (fr); x < (to); x++)
#define rep(x, to) for (int x = 0; x < (to); x++)
#define repr(x, fr, to) for (int x = (fr); x >= (to); x--)
#define all(c) c.begin(), c.end()
#define sz(v) (int)v.size()
using namespace std;
typedef long long ll;
typedef vector<int> V... | replace | 25 | 26 | 25 | 26 | 0 | |
p02695 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN
#define fi first
#define se second
#define pb push_back
#define f_s(a) sort(a.begin(), a.end())
#define b_s(a) sort(a.rbegin(), a.rend())
#... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN
#define fi first
#define se second
#define pb push_back
#define f_s(a) sort(a.begin(), a.end())
#define b_s(a) sort(a.rbegin(), a.rend())
#... | replace | 79 | 80 | 79 | 80 | TLE | |
p02695 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const long long INF = INT_MAX / 4;
const long long MOD = 1'000'000'007;
const double EPS = 1e-14;
const bool DEBUG = false;
const string YES = "YES";
const string NO = "NO";
const string Yes = "Yes";
const string No ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const long long INF = INT_MAX / 4;
const long long MOD = 1'000'000'007;
const double EPS = 1e-14;
const bool DEBUG = false;
const string YES = "YES";
const string NO = "NO";
const string Yes = "Yes";
const string No ... | replace | 40 | 41 | 40 | 41 | 0 | |
p02695 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | replace | 1,129 | 1,130 | 1,129 | 1,134 | 0 | |
p02696 | Python | Time Limit Exceeded | A, B, N = map(int, input().split())
c = 0
t = -10
if N > 100000000:
for i in range(100000000, N + 1):
a = (i * A) // B - A * (i // B)
c = max(c, a)
if t > a or i > 1100000000:
print(c)
break
t = a
else:
print(c)
else:
for i in range(N + 1):
... | A, B, N = map(int, input().split())
X = min(N, B - 1)
print(A * X // B - A * (X // B))
| replace | 1 | 23 | 1 | 3 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define REP(i, d, n) for (long long i = (d); i < (n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() { // 言語変えろ言語変えろ言語変えろ言語変えろ言語変えろ
ll a, b, n;
cin >> a >> b >> n;
ll max = -999999;
ll a... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define REP(i, d, n) for (long long i = (d); i < (n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() { // 言語変えろ言語変えろ言語変えろ言語変えろ言語変えろ
ll a, b, n;
cin >> a >> b >> n;
ll max = -999999;
ll a... | replace | 13 | 18 | 13 | 17 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll max = 0;
for (ll i = 0; i <= m... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;
int main() {
ll a, b, n;
cin >> a >> b >> n;
cout << a * min(n, b - 1) / b;
re... | replace | 15 | 22 | 15 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
// マクロ&定数&関数 ===========... | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
// マクロ&定数&関数 ===========... | replace | 428 | 446 | 428 | 431 | TLE | |
p02696 | C++ | Runtime Error | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
vector<long double> ans(n, 0);
for (int i = 1; i <= n; i++)
ans[i - 1] = floor(a * i / b) - a * floor(i / b);
sort(ans.begin(), ans.end());
cout << floor(ans[n - 1]) << endl;
} | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (b > n)
cout << floor(a * n / b) << endl;
else
cout << floor(a * (b - 1) / b) << endl;
} | replace | 9 | 17 | 9 | 13 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define rreps(i, n, s) for (int i = s; i >= n; i--)
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
... | #include <bits/stdc++.h>
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define rreps(i, n, s) for (int i = s; i >= n; i--)
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
... | replace | 33 | 39 | 33 | 37 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long z = floor(a / b) - a * floor(1 / b);
for (int i = 2; i <= n; i++) {
int z1 = floor(a * i / b) - a * floor(i / b);
if (z1 > z)
z = z1;
}
cout << z << endl;
} | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
if (c >= b)
c = b - 1;
cout << floor(a * c / b) - a * floor(c / b) << endl;
} | replace | 5 | 14 | 5 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | // ABC165D -
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int A, B, N;
cin >> A >> B >> N;
long long int ans = N * A / B - N / B * A;
for (long long int i = B - 1; i <= N; i += B) {
if ((i * A / B - i / B * A) >= ans) {
ans = i * A / B - i / B * A;
}
}
cout << ans <... | // ABC165D -
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int A, B, N;
cin >> A >> B >> N;
long long int ans = 0;
if (N >= B - 1) {
ans = A * (B - 1) / B;
} else {
ans = A * N / B;
}
cout << ans << endl;
return 0;
}
| replace | 9 | 14 | 9 | 14 | TLE | |
p02696 | C++ | Time Limit Exceeded | //----AUTHOR:kkdrummer----/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
// typedef unordered_set<ll> usll;
// typedef unordered_multiset<ll> umsll;
typedef multiset<ll> msll;
typedef set<ll> sl... | //----AUTHOR:kkdrummer----/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
// typedef unordered_set<ll> usll;
// typedef unordered_multiset<ll> umsll;
typedef multiset<ll> msll;
typedef set<ll> sl... | replace | 132 | 140 | 132 | 133 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define etm \
cerr << "Time elapse... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define etm \
cerr << "Time elapse... | replace | 365 | 369 | 365 | 370 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define lson node << 1, st, mid
#define rson node << 1 | 1, mid + 1, ed
#define mem(a, x) m... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define lson node << 1, st, mid
#define rson node << 1 | 1, mid + 1, ed
#define mem(a, x) m... | replace | 37 | 55 | 37 | 43 | TLE | |
p02696 | C++ | Time Limit Exceeded | // 失敗するからこそ
// そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) \
cerr << "[" << #x << "] = ["; \
_print(x)
#else
#include <bits/stdc++.h>
#define deb(x...... | // 失敗するからこそ
// そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) \
cerr << "[" << #x << "] = ["; \
_print(x)
#else
#include <bits/stdc++.h>
#define deb(x...... | replace | 40 | 45 | 40 | 47 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// マクロ
// forループ関係
// 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
// Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) fo... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// マクロ
// forループ関係
// 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
// Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) fo... | replace | 49 | 50 | 49 | 58 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#include "math.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef vector<pair<ll, ll>> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); +... | #include "bits/stdc++.h"
#include "math.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef vector<pair<ll, ll>> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); +... | replace | 20 | 28 | 20 | 28 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#include "math.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll, ll> P;
typedef vector<P> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define dre... | #include "bits/stdc++.h"
#include "math.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll, ll> P;
typedef vector<P> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define dre... | replace | 26 | 35 | 26 | 28 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (long long i = 0; i < (long long)c; i++)
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0;
long long t;
rep(x, n + 1) {
t = floor(a * x / b) - a * floor(x / b);
ans = max(t, ans);
}
cout << ans << endl;
retu... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (long long i = 0; i < (long long)c; i++)
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0;
long long t;
/* rep(x,n+1){
t=floor(a*x/b)-a*floor(x/b);
ans = max(t,ans);
}
*/
... | replace | 8 | 12 | 8 | 15 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
int main() {
long long a, b, n, max;
cin >> a >> b >> n;
max = a / b - (1 / b) * a;
for (long long i = 2; i <= n; i++) {
if (((a * i) / b - (i / b) * a) > max) {
max = (a * i) / b - (i / b) * a;
}
}
cout << max << endl;
return 0;
... | #include <iostream>
#include <vector>
using namespace std;
int main() {
long long a, b, n, max;
cin >> a >> b >> n;
if (a < b) {
if ((b - 1) < n) {
max = (a * (b - 1)) / b;
} else {
max = (a * n) / b;
}
} else {
max = (a * n) / b - a * (n / b);
long long temp = (n / b) * b - 1;... | replace | 8 | 12 | 8 | 20 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
long long int A, B, x;
cin >> A >> B >> x;
long long int ans = 0;
// ans = max(ans, (A*x)/B - A*(x/B));
// if (B... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
long long int A, B, N;
cin >> A >> B >> N;
long long int m = min(B - 1, N);
cout << (A * m) / B - A * (m / B);
... | replace | 8 | 24 | 8 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | /*
No matter how long a night, dawn will always break.
Simular saying ... The darkest hour is just before the dawn.
*************************************** ************************8
**********************************
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
... | /*
No matter how long a night, dawn will always break.
Simular saying ... The darkest hour is just before the dawn.
*************************************** ************************8
**********************************
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
... | insert | 57 | 57 | 57 | 61 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define int long long... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define int long long... | replace | 50 | 56 | 50 | 53 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <tgmath.h>
#include <unordered_ma... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <tgmath.h>
#include <unordered_ma... | replace | 287 | 299 | 287 | 296 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define irep(i, a, b) for (ll i = ll(a); i >= ll(b); i--)
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
... | #include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define irep(i, a, b) for (ll i = ll(a); i >= ll(b); i--)
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
... | replace | 35 | 36 | 35 | 36 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()... | replace | 29 | 35 | 29 | 60 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
ll a, b, n;
int main() {
cin >> a >> b >> n;
ll x;
ll ans;
if (n < b) {
ans = (a * n) / b - a * (n / b);
cout << ans;
return 0;
} else if (n == b) {
x = n - 1;
ans = (a * n) / b - a * (n / b);
ll ans1 =... | #include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
ll a, b, n;
int main() {
cin >> a >> b >> n;
ll x;
ll ans;
if (n < b) {
ans = (a * n) / b - a * (n / b);
cout << ans;
return 0;
} else if (n == b) {
x = n - 1;
ans = (a * n) / b - a * (n / b);
ll ans1 =... | replace | 23 | 27 | 23 | 36 | TLE | |
p02696 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i, a, b) for (i = a; i < b; i++)
#define foe(i, a, b) for (i = a; i <= b; i++)
#define all(x... | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i, a, b) for (i = a; i < b; i++)
#define foe(i, a, b) for (i = a; i <= b; i++)
#define all(x... | replace | 30 | 31 | 30 | 33 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans = 0;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll k = min(b, n);
rep(i, k + 1) { ans = max(ans, (a * i) / b - a * (i / b)); }
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans = 0;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll k = min(b - 1, n);
ans = max(ans, (a * k) / b - a * (k / b));
cout << ans << endl;
return 0;
} | replace | 9 | 11 | 9 | 11 | TLE | |
p02696 | C++ | Runtime Error | #include <bits/stdc++.h>
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000... | #include <bits/stdc++.h>
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000... | delete | 43 | 45 | 43 | 43 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) f... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) f... | replace | 27 | 34 | 27 | 31 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long int ans = 0;
long int a, b, n, x;
cin >> a >> b >> n;
if (n < b) {
x = n;
} else if (n == b) {
x = b - 1;
} else {
x = b;
while (n > (x + b))
x += b;
x--;
}
ans = ((a * x) / b) - a * (x / b);
cout << ans << en... | #include <bits/stdc++.h>
using namespace std;
int main() {
long int ans = 0;
long int a, b, n, x;
cin >> a >> b >> n;
if (n < b) {
x = n;
} else if (n == b) {
x = b - 1;
} else {
x = (n / b) * b - 1;
}
ans = ((a * x) / b) - a * (x / b);
cout << ans << endl;
}
| replace | 13 | 17 | 13 | 14 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
template <class T> struct rge {
T b, e;
};
template <class T> rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
template <class T> debug &operator<<(T x) {
cerr << boolalpha << x;
return *this;
}
templat... | #include <bits/stdc++.h>
using namespace std;
template <class T> struct rge {
T b, e;
};
template <class T> rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
template <class T> debug &operator<<(T x) {
cerr << boolalpha << x;
return *this;
}
templat... | replace | 41 | 58 | 41 | 43 | TLE | |
p02696 | C++ | Time Limit Exceeded | /*
GOOD is not Enough
You've got to be GREAT.
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define mod 1000000007
#define FAST ios::s... | /*
GOOD is not Enough
You've got to be GREAT.
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define mod 1000000007
#define FAST ios::s... | replace | 31 | 47 | 31 | 33 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll max = 0;
for (ll i = N; i >= 0; i--) {
ll tmp = floor((A * i) / B) - A * floor(i / B);
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll max = 0;
/*
for(ll i = N; i > 0; i--){
if()
ll tmp = floor((A * i)/B) - A*floor(... | replace | 12 | 16 | 12 | 32 | TLE | |
p02696 | C++ | Time Limit Exceeded | // g++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#inclu... | // g++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#inclu... | replace | 43 | 49 | 43 | 49 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
// 全探索
ll ans = 0;
for (ll x = 0; x <= n; ++x) {
ll fst = a * x / b;
ll scd = x / b;
scd *= a;
ll flr = f... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x = min(b - 1, n);
int ans = int(a * x / b) - a * int(x / b);
// // 全探索
// ll ans = 0;
// for(ll x = 0; x <= n; ++... | replace | 10 | 19 | 10 | 21 | TLE | |
p02696 | C++ | Time Limit Exceeded | /*
--------DO NOT COPY I REQUEST YOU PLEASE--------
AUTHOR : Chandan Agrawal
College : Poornima College of Engg. jaipur, Raj
Mail : chandanagrawal23@gmail.com
██████╗ ██╗ ██╗ █████╗ ███╗ ██╗ ██████╗ █████╗ ███╗ ██╗
██╔════╝ ██║ ██║ ██╔══██╗ ████╗ ██║ ██╔══██╗ ██╔══██╗ ████╗ ██║
██║ ███████║ ██████... | /*
--------DO NOT COPY I REQUEST YOU PLEASE--------
AUTHOR : Chandan Agrawal
College : Poornima College of Engg. jaipur, Raj
Mail : chandanagrawal23@gmail.com
██████╗ ██╗ ██╗ █████╗ ███╗ ██╗ ██████╗ █████╗ ███╗ ██╗
██╔════╝ ██║ ██║ ██╔══██╗ ████╗ ██║ ██╔══██╗ ██╔══██╗ ████╗ ██║
██║ ███████║ ██████... | replace | 370 | 377 | 370 | 389 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// Shortening code
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;
// Macros
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define REP(i, a, b) for (int i = a; i <... | #include <bits/stdc++.h>
using namespace std;
// Shortening code
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;
// Macros
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define REP(i, a, b) for (int i = a; i <... | replace | 24 | 29 | 24 | 26 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pint pair<int, int>
#define pll pair<ll, ll>
#define vint vector<int>
#define vll vector<ll>
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
const int IN... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pint pair<int, int>
#define pll pair<ll, ll>
#define vint vector<int>
#define vll vector<ll>
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
const int IN... | insert | 17 | 17 | 17 | 21 | TLE | |
p02696 | C++ | Time Limit Exceeded | /**
* @copyright (c) 2020 Daisuke Hashimoto
*/
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;
// std::cout << std::setprecision(20) << 1.1 << endl;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int64_t A, B, N;
cin >> A >> B >> N;
int64_t m... | /**
* @copyright (c) 2020 Daisuke Hashimoto
*/
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;
// std::cout << std::setprecision(20) << 1.1 << endl;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int64_t A, B, N;
cin >> A >> B >> N;
int64_t m... | replace | 17 | 24 | 17 | 18 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
ll INF = 1 << 25;
int ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
ll INF = 1 << 25;
int ... | replace | 21 | 27 | 21 | 30 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define deb(x) cerr << #x << ": " << x << '\n';
#define ios \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define deb(x) cerr << #x << ": " << x << '\n';
#define ios \
ios_base::sync_with_stdio(false); ... | replace | 16 | 24 | 16 | 19 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
typedef long long ll;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
using namespace std;
typedef pair<int, int> P;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = 0;
ll prev = 0;
int flag = 0;
for (ll x = 1; x < n + 1; x++) {
prev = ans;
ans = floor(a * x / b) -... | #include <bits/stdc++.h>
typedef long long ll;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
using namespace std;
typedef pair<int, int> P;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x = min(b - 1, n);
cout << floor(a * x / b) - (a * floor(x / b)) << endl;
return 0;
} | replace | 9 | 23 | 9 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
long long int a, b, n, v, i, max, tmp;
scanf("%lld %lld %lld", &a, &b, &n);
max = 0;
for (i = 1; i <= n && i <= b * 2; i++) {
v = floor(a * i * 1.00 / b) - a * floor(i / b);
if (v > max)
max = v;
}
printf("%lld\n", max);
... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
long long int a, b, n, v, i, max, tmp;
scanf("%lld %lld %lld", &a, &b, &n);
max = 0;
if (n < b) {
max = floor(a * n * 1.00 / b);
} else {
max = floor(a * (b - 1) * 1.00 / b);
}
printf("%lld\n", max);
return 0;
}
| replace | 8 | 12 | 8 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
long long int B, N;
cin >> A >> B >> N;
long long int output, num;
output = 0;
if (N > B) {
N = B;
}
for (int i = 1; i <= N; i++) {
num = floor((A * i) / B) - A * floor(i / B);
if (num >= output) {
output = num;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int A;
long long int B, N;
cin >> A >> B >> N;
if (N > B - 1)
N = B - 1;
cout << floor(A * N / B) - A * (N / B) << endl;
return 0;
} | replace | 8 | 22 | 8 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define Yes... | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define Yes... | replace | 17 | 24 | 17 | 24 | TLE | |
p02696 | C++ | Time Limit Exceeded | // Floor Function
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll a, b, n;
ll f(ll x) {
ll A = floor(a * x / b);
// cout << A << endl;
ll B = floor(x / b);
return A - a * B;
}
int main() {
cin >> a >> b >> n;
ll ans = 0;
for (ll i = 1; i <= n; i++) {
... | // Floor Function
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll a, b, n;
ll f(ll x) {
ll A = floor(a * x / b);
// cout << A << endl;
ll B = floor(x / b);
return A - a * B;
}
int main() {
cin >> a >> b >> n;
ll ans = 0;
if (b - 1 <= n) {
ans = f(b - ... | replace | 18 | 21 | 18 | 22 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cinttypes>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
using u8t = std::uint64_t;
using i8t = std::int64_t;
#define F(I, N) for (i8t I = 0, I##_N = N; I < I##_N; I++)
#define FR(I, N) f... | #include <algorithm>
#include <cinttypes>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
using u8t = std::uint64_t;
using i8t = std::int64_t;
#define F(I, N) for (i8t I = 0, I##_N = N; I < I##_N; I++)
#define FR(I, N) f... | insert | 34 | 34 | 34 | 36 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;
const int INF = 1e9 + 7;
const int MOD = 1e9 +... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;
const int INF = 1e9 + 7;
const int MOD = 1e9 +... | replace | 66 | 71 | 66 | 68 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int f(long long a, long long b, long long x) {
long long s = a * x / b;
long long t = a * (x / b);
return s - t;
}
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0;
for (long long i = n / 2; i <= n; i++) {
if (ans < f(a, b, i))
ans =... | #include <iostream>
using namespace std;
int f(long long a, long long b, long long x) {
long long s = a * x / b;
long long t = a * (x / b);
return s - t;
}
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0;
if (b > n) {
ans = f(a, b, n);
} else {
ans = f(a, b, b - 1);
}
... | replace | 12 | 15 | 12 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
long long A, B, N;
long long dif(long long x) {
long long a = A * x;
a /= B;
long long b = x / B;
b *= A;
return a - b;
}
long long bi(long ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
long long A, B, N;
long long dif(long long x) {
long long a = A * x;
a /= B;
long long b = x / B;
b *= A;
return a - b;
}
long long bi(long ... | replace | 21 | 22 | 21 | 22 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define endl '\n'
#define fi first
#define se second
#define MOD(n, k) ((((n) % (k)) + (k)) % (k))
#define forn(i, n) for (int i = 0; i < n; i++)
#define forr(i, a, b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)
using namespace std;
typedef long ... | #include <bits/stdc++.h>
#define endl '\n'
#define fi first
#define se second
#define MOD(n, k) ((((n) % (k)) + (k)) % (k))
#define forn(i, n) for (int i = 0; i < n; i++)
#define forr(i, a, b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)
using namespace std;
typedef long ... | replace | 28 | 32 | 28 | 33 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define All(V) V.begin(), V.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7, INF = 1e9;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = (ll)(floor(a * n) / b) - (ll)(a * floor(n / b)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define All(V) V.begin(), V.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7, INF = 1e9;
int main() {
ll a, b, n;
cin >> a >> b >> n;
cout << a * min(n, b - 1) / b << endl;
system("pause"... | replace | 11 | 18 | 11 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(), (x).end()
#define f(i, a, b) for (int i = a; i < (signed)(b); ++i)
#define pc __builtin_popcount // counts number of 1's in bin(num)
#define pb push_back
#define mp mak... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(), (x).end()
#define f(i, a, b) for (int i = a; i < (signed)(b); ++i)
#define pc __builtin_popcount // counts number of 1's in bin(num)
#define pb push_back
#define mp mak... | replace | 63 | 69 | 63 | 65 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, n;
long long int res = 0;
cin >> a >> b >> n;
long long int i = 0;
while (i <= n && (i / b) < 1) {
long long int tmp = floor(a * i / b);
res = max(res, tmp);
++i;
}
cout << res << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, n;
long long int res = 0;
cin >> a >> b >> n;
long long int i = min(n, b - 1);
res = floor(a * i / b);
/*
while (i<=n && (i/b)<1){
long long int tmp=floor(a*i/b);
res=max(res,tmp);
++i;
}
*... | replace | 7 | 15 | 7 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | /**
* D - Floor Function
* https://atcoder.jp/contests/abc165/tasks/abc165_d
*/
#include <bits/stdc++.h>
using namespace std;
long long A, B, N;
long long calc(long long x) {
long long floor1 = A * x / B;
long long floor2 = x / B;
return floor1 - A * floor2;
}
int main() {
// 整数 A, B, N が与えられます。
cin >> ... | /**
* D - Floor Function
* https://atcoder.jp/contests/abc165/tasks/abc165_d
*/
#include <bits/stdc++.h>
using namespace std;
long long A, B, N;
long long calc(long long x) {
long long floor1 = A * x / B;
long long floor2 = x / B;
return floor1 - A * floor2;
}
int main() {
// 整数 A, B, N が与えられます。
cin >> ... | replace | 22 | 31 | 22 | 26 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll Ans = 0;
for (int i = 0; i <= N; i++) {
ll num = (A * i / B) - A * (i / B);
Ans = max(Ans, num);
}
cout << An... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll ans;
if (N < B)
ans = (A * N / B);
else
ans = (A * (B - 1) / B);
cout << ans << endl;
return 0;
} | replace | 9 | 15 | 9 | 15 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll sum = 0, prevSum = -1;
for (ll x = 1; x <= n; x++) {
sum = floor((a * x) / b) - a * floor(x / b);
// cout<<x<<" "<<sum<<" "<<prevSum<<endl;
if (prevSum == -1) {
prevSum = sum;
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n >= b)
cout << floor(a * (b - 1) / b) << endl;
else
cout << floor(a * (n) / b) << endl;
return 0;
}
| replace | 7 | 22 | 7 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18 + 1;
const ll... | #include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18 + 1;
const ll... | replace | 28 | 44 | 28 | 32 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> a >> b >> n;
if (b > n) {
cout << a * n / b << endl;
return 0;
}
long long y = n / b;
priority_queue<long long> pq;
for (int i = 1; i < y + 1; i++) {
pq.push(b * i - 1);
}
pq.push(n);
long long max = 0... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> a >> b >> n;
if (b > n) {
cout << a * n / b << endl;
return 0;
}
cout << a * (b - 1) / b << endl;
return 0;
} | replace | 11 | 27 | 11 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll res = 0;
for (int i = 0; i <= n; i++) {
ll tmp = floor(a * i / b) - a * floor(i / b);
res = max(res, tmp);
}
cout << res << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x = n;
if (b <= n)
x = b - 1 ? b - 1 : 1;
ll res = floor(a * x / b) - a * floor(x / b);
cout << res << endl;
}
| replace | 10 | 15 | 10 | 14 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.