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
p02696
C++
Time Limit Exceeded
// include //------------------------------------------ #include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list...
// include //------------------------------------------ #include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list...
replace
95
100
95
100
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define fr(i, n) for (int i = 0; i < (n); ++i) #define foor(i, a, b) for (int i = (a); i <= (b); ++i) #define rf(i, n) for (int i = (n); i-- > 0;) #define roof(i, b, a) for (int i = (b); i >= (a); --i) #define elsif else if #define all(x) x.begin(), x.end() #define Sort(x) sort(all(x)) #define ...
#include <bits/stdc++.h> #define fr(i, n) for (int i = 0; i < (n); ++i) #define foor(i, a, b) for (int i = (a); i <= (b); ++i) #define rf(i, n) for (int i = (n); i-- > 0;) #define roof(i, b, a) for (int i = (b); i >= (a); --i) #define elsif else if #define all(x) x.begin(), x.end() #define Sort(x) sort(all(x)) #define ...
replace
693
696
693
694
TLE
p02696
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include ...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include ...
replace
74
82
74
78
0
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) printf("%.10f\n", a) #define mem(a) memset(a, 0, sizeof(a)) #define all(c) (c).begin(), (c).end() ...
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define R cin >> #define Z class #define ll long long #define ln cout << '\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) printf("%.10f\n", a) #define mem(a) memset(a, 0, sizeof(a)) #define all(c) (c).begin(), (c).end() ...
replace
39
47
39
41
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, N; cin >> A >> B >> N; // long long x = max(N, B-1); long long ans_max = -1; // cerr << (long long)((A * x) / B) << ", " << (A * (long long)(x / B)) << // endl; long long ans = (long long)((A * x) / B) - (A * (long long)(x / B)); ...
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, N; cin >> A >> B >> N; long long x = min(B - 1, N); cout << (long long)(A * x / B) - A * (long long)(x / B) << endl; return 0; }
replace
6
19
6
8
TLE
p02696
C++
Time Limit Exceeded
#include <iostream> #include <math.h> using namespace std; int main() { int x = 1; int max = -1; double a, b, n; cin >> a >> b >> n; long long dif; for (int i = 1; i <= n; i++) { dif = floor(a * i / b) - a * floor(i / b); if (dif > max) max = dif; } cout << max; return 0; }
#include <iostream> #include <math.h> using namespace std; int main() { int x = 1; int max = -1; double a, b, n; cin >> a >> b >> n; long long dif; dif = b - 1; if (n < b - 1) dif = n; max = floor(a * dif / b) - a * floor(dif / b); cout << max; return 0; }
replace
9
15
9
13
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, m, n) for (int i = m; i < n; i++) typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> Pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vll; template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, m, n) for (int i = m; i < n; i++) typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> Pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vll; template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; ...
insert
30
30
30
32
TLE
p02696
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { unsigned long long a, b, n; cin >> a >> b >> n; unsigned long long mx = 0; for (unsigned long long x = 1; x <= n; x++) { unsigned long long s = (unsigned long long)(a * x / b) - a * ((unsigned long long)(x / b)); if (s > mx) { mx = s; ...
#include <iostream> using namespace std; int main() { unsigned long long a, b, n; cin >> a >> b >> n; unsigned long long x = b - 1; if (n < x) x = n; unsigned long long s = (unsigned long long)(a * x / b) - a * ((unsigned long long)(x / b)); cout << s << endl; return 0; }
replace
6
15
6
12
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; typedef long double ld; #define sz(a) int((a).size()) #define forn(i, n) for (int i = 0; i < int(n); ++i) #defin...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; typedef long double ld; #define sz(a) int((a).size()) #define forn(i, n) for (int i = 0; i < int(n); ++i) #defin...
replace
38
39
38
39
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; void solve(long long A, long long B, long long N) { long long ans = 0; for (long long i = 1; i <= B - 1 && i <= N; i++) { ans = max(ans, (A * (i % B) - (A * i) % B) / B); } cout << ans << endl; } // Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-t...
#include <bits/stdc++.h> using namespace std; void solve(long long A, long long B, long long N) { long long x = N < B ? N : B - 1; long long ans = floor((A * (x % B)) / B); cout << ans << endl; } // Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You // use the default template now. Yo...
replace
4
8
4
6
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (long long i = 0; i < (n); i++) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; ret...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (long long i = 0; i < (n); i++) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; ret...
replace
25
28
25
26
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <assert.h> #include <bitset> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <assert.h> #include <bitset> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric...
replace
238
247
238
240
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, n, t, k, k1; cin >> a >> b >> n; if (b > n) { cout << (a * n) / b; } else { t = b - 1; k = ((a * t) / b) - (a * (t / b)); while (1) { t++; if (t > n) { break; } k1 = ((a * t) / b) - (a ...
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, n, t, k, k1; cin >> a >> b >> n; if (b > n) { cout << (a * n) / b; } else { cout << (a * (b - 1)) / b; } }
replace
8
23
8
9
TLE
p02696
C++
Time Limit Exceeded
#include <iostream> #include <vector> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #include <memory> #include <string> #define Rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } int lcm(int a, int b) {...
#include <iostream> #include <vector> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #include <memory> #include <string> #define Rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } int lcm(int a, int b) {...
replace
38
47
38
43
TLE
p02696
C++
Time Limit Exceeded
#include <iostream> #include <vector> int main() { int64_t A, B, N; std::cin >> A >> B >> N; int64_t max = 0; for (auto i = 0; i <= N; ++i) { auto score = (A * i / B) - A * (i / B); // std::cout << score << std::endl; if (max < score) max = score; } std::cout << max << std::endl; }
#include <iostream> #include <vector> int main() { int64_t A, B, N; std::cin >> A >> B >> N; auto maxX = std::min(B - 1, N); std::cout << (A * maxX / B) - A * (maxX / B) << std::endl; }
replace
7
17
7
9
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // #pragma GCC optimize("Ofast") #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin...
#include <bits/stdc++.h> using namespace std; // #pragma GCC optimize("Ofast") #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin...
replace
88
91
88
92
TLE
p02696
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <limits> using namespace std; int main() { long long A, B, N; cin >> A >> B >> N; long long Y = 0; long long Ans = 0; for (int x = 0; x <= N; x++) { Y = floor(A * x / B) - A * floor(x / B); if (Ans < Y) Ans = Y; } cout << Ans << endl; retur...
#include <cmath> #include <iostream> #include <limits> using namespace std; int main() { long long A, B, N; cin >> A >> B >> N; long long Y = 0; long long Ans = 0; if (N >= B) Ans = floor(A * (B - 1) / B) - A * floor((B - 1) / B); else if (N < B) Ans = floor(A * (N) / B) - A * floor(N / B); cou...
replace
11
16
11
15
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <tuple>#include <iostream> #include <tuple> #include <vector> #define FOR(i, a, b) for (int i = a; i < b; i++) #d...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <tuple>#include <iostream> #include <tuple> #include <vector> #define FOR(i, a, b) for (int i = a; i < b; i++) #d...
replace
36
42
36
38
TLE
p02696
C++
Time Limit Exceeded
#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() using namespace std; typedef long long ll; int main() { ll A, B, N; cin >> A >> B >> N; ll ans =...
#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() using namespace std; typedef long long ll; int main() { ll A, B, N; cin >> A >> B >> N; ll ans =...
replace
13
17
13
15
TLE
p02696
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #i...
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #i...
replace
66
68
66
68
TLE
p02696
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { double a, b, n; cin >> a >> b >> n; int max = 0; double temp = min(b - 1, n); for (double i = 0; i <= temp; i++) { int v = floor(a * i / b) - a * floor(i / b); if (max < v) max = v; } cout << max << endl; }
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { double a, b, n; cin >> a >> b >> n; int max = 0; double temp = min(b - 1, n); // for (double i = 0; i <= temp; i++) // { int v = floor(a * temp / b) - a * floor(temp / b); // if (max < v) // max = v; // } co...
replace
11
17
11
18
TLE
p02696
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a, b, n; scanf("%lld %lld %lld", &a, &b, &n); if (n % b == 0) b--; printf("%lld\n", a * n / b - a * (n / b)); }
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a, b, n; scanf("%lld %lld %lld", &a, &b, &n); if (b <= n) n = n / b * b - 1; printf("%lld\n", a * n / b - a * (n / b)); }
replace
8
10
8
10
0
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <set> #include <vector> #define ll long long using namespace std; int main() { ll a, b, n; ll fx; ll res = 0; cin >> a >> b >> n; for (int x = 0; x <= (n < b ? n : b); ++x) { // cout << "x = " << x << ends; fx = floo...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <set> #include <vector> #define ll long long using namespace std; int main() { ll a, b, n; ll fx; ll res = 0; cin >> a >> b >> n; /* for (int x = 0; x <= (n<b?n:b); ++x) { cout << "x = " << x << ends; ...
replace
16
23
16
28
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> using namespace std; long long a, b, n, maxn, m; int main(void) { scanf("%lld%lld%lld", &a, &b, &n); for (int i = b - 1; i <= n; i++) { m = a * i / b - a * (i / b); maxn = max(maxn, m); i += b; } m = a * n / b - a * (n / b); maxn = max(maxn, m); printf("...
#include <algorithm> #include <cstdio> using namespace std; long long a, b, n, maxn, m; int main(void) { scanf("%lld%lld%lld", &a, &b, &n); if (b - 1 <= n) maxn = a * (b - 1) / b - a * ((b - 1) / b); m = a * n / b - a * (n / b); maxn = max(maxn, m); printf("%lld", maxn); return 0; }
replace
8
13
8
10
TLE
p02696
C++
Runtime Error
// @prefix atcoder // @description atcoder template #include <bits/stdc++.h> using namespace std; #define int long long // typedef //------------------------------------------ typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef vector<PII> VP; // rep //-----...
// @prefix atcoder // @description atcoder template #include <bits/stdc++.h> using namespace std; #define int long long // typedef //------------------------------------------ typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef vector<PII> VP; // rep //-----...
replace
62
66
62
70
0
p02696
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int A, B, N; cin >> A >> B >> N; cout << N / (abs(A - B)) << endl; }
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int A, B, N; cin >> A >> B >> N; if (B > N) { cout << (A * N) / B - (A * (N / B)) << endl; return 0; } else { int x = N - (N % B) - 1; cout << (A * x) / B - (A * (x / B)) << endl; return 0; } }
replace
7
8
7
15
0
p02696
C++
Time Limit Exceeded
/*我是萌新*/ #include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <string> typedef long long ll; const int mod = 1e9 + 7; using namespace std; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } int main() {...
/*我是萌新*/ #include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <string> typedef long long ll; const int mod = 1e9 + 7; using namespace std; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } int main() {...
replace
19
26
19
29
TLE
p02696
C++
Time Limit Exceeded
// author: zekigurbuz (Zeki Gurbuz) 2020 #pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define mp make_pair #define pb push_back #define lb lower_bound #define all(x) begin(x), end(x) const int N = 1e5 + 10; const...
// author: zekigurbuz (Zeki Gurbuz) 2020 #pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define mp make_pair #define pb push_back #define lb lower_bound #define all(x) begin(x), end(x) const int N = 1e5 + 10; const...
replace
31
46
31
32
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<ll>; using vii = vector<vi>; using Pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(x) ((int)x.size()) #define pb push_back #define mp make_pair #define mt make_tuple ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<ll>; using vii = vector<vi>; using Pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(x) ((int)x.size()) #define pb push_back #define mp make_pair #define mt make_tuple ...
replace
35
42
35
39
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18, MOD = 1e9 + 7; const int INT_INF = 1e9, INT_MOD = 1e9 + 7; #define rep(i, N) for (int i = 0; i < N; i++) typedef pair<int, int> Pi; typedef pair<double, double> P; signed main() { ll a, b, n; cin >> a >> b >> n; ll maxa = (a...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18, MOD = 1e9 + 7; const int INT_INF = 1e9, INT_MOD = 1e9 + 7; #define rep(i, N) for (int i = 0; i < N; i++) typedef pair<int, int> Pi; typedef pair<double, double> P; signed main() { ll a, b, n; cin >> a >> b >> n; ll maxa = (a...
replace
14
20
14
21
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <iterator> #include <math.h> #include <numeric> #include <sstream> #include <string> #include <vector> using namespace std; #define endl ("\n") #define pi (3.141592653589) #define mod 1000000007 #define int int64_t #define float double #define...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <iterator> #include <math.h> #include <numeric> #include <sstream> #include <string> #include <vector> using namespace std; #define endl ("\n") #define pi (3.141592653589) #define mod 1000000007 #define int int64_t #define float double #define...
replace
40
47
40
43
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <tuple> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; int main(int argc, char *argv[]) { ll i; ll a, b, n; ll ans = 0; ll tmp, start...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <tuple> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; int main(int argc, char *argv[]) { ll i; ll a, b, n; ll ans = 0; ll tmp, start...
replace
20
24
20
34
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <deque> // deque #include <iomanip> // setprecision #include <iostream> // cout, endl, cin #include <map> // map #include <math.h> // sqrt #include <queue> // queue, priority_queue #include <set> // set #i...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <deque> // deque #include <iomanip> // setprecision #include <iostream> // cout, endl, cin #include <map> // map #include <math.h> // sqrt #include <queue> // queue, priority_queue #include <set> // set #i...
replace
27
35
27
29
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int a; int64_t b, n; cin >> a >> b >> n; int64_t p; if (n < b) { p = n; } else { p = b - 1; } int maximum = 0; for (int i = 1; i <= p; i++) { int64_t x = a * i / b - i / b * a; maximum = max((int)x, maximum); } cout << max...
#include <bits/stdc++.h> using namespace std; int main() { int a; int64_t b, n; cin >> a >> b >> n; int64_t p; if (n < b) { p = n; } else { p = b - 1; } cout << a * p / b << endl; }
replace
13
19
13
14
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; using LLONG = long long; const LLONG MOD = 1000000007; int main() { LLONG A, B, N; cin >> A >> B >> N; LLONG ans...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; using LLONG = long long; const LLONG MOD = 1000000007; int main() { LLONG A, B, N; cin >> A >> B >> N; LLONG x =...
replace
18
26
18
23
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 rrep(i, m, n) for (int i = (m); i < (n); i++) #define fore(i, a) for (auto &i : a) #define debug(a, b) cout << "debug : " << a << " , " << b << endl using ll = long long; const ll INF = 1LL << 60; const ll mod = 1E9 + ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, m, n) for (int i = (m); i < (n); i++) #define fore(i, a) for (auto &i : a) #define debug(a, b) cout << "debug : " << a << " , " << b << endl using ll = long long; const ll INF = 1LL << 60; const ll mod = 1E9 + ...
replace
13
22
13
18
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ul unsigned long long int #define ld long double #define f(t) for (ll i = 0; i < t; i++) #define vi vector<int> #define vl vector<ll> #define pb push_back #define ff first #define ss second #define MOD 1000000007 #define inf 4e18 #define EPS...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ul unsigned long long int #define ld long double #define f(t) for (ll i = 0; i < t; i++) #define vi vector<int> #define vl vector<ll> #define pb push_back #define ff first #define ss second #define MOD 1000000007 #define inf 4e18 #define EPS...
replace
47
69
47
49
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) ll func(ll a, ll b, double x) { ll ans = (ll)(a * x / b) - a * (ll)(x / b); return ans; } int main(...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) ll func(ll a, ll b, double x) { ll ans = (ll)(a * x / b) - a * (ll)(x / b); return ans; } int main(...
replace
20
25
20
23
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>; const ll INF = 1e18; const int MX = 2005; int main() { ll a, b, n; cin >> a >> b >> n; ll ans = 0; ; rep(x, min(n + 1, b)) { ans = max(ans, (a * x) / b - a * (x / b))...
#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>; const ll INF = 1e18; const int MX = 2005; int main() { ll a, b, n; cin >> a >> b >> n; ll ans = min(n, b - 1) * a / b; cout << ans << endl; }
replace
12
15
12
13
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 cost = 0; rep(x, n + 1) cost = max(cost, ll(floor(a * x / b) - a * floor(x / b))); cout << cost << endl; return 0; }
#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 = n; if (n >= b - 1) x = b - 1; ll ans = floor(a * x / b) - a * floor(x / b); cout << ans << endl; return 0; }
replace
9
12
9
14
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef long long ll; int main() { ll a, b, n; cin >> a >> b >> n; ll flag = -inf; for (ll i = 1; i <= n; i++) { ll res = (a * i) / b; ll ans = a * (i / b); flag = max(res - ans, flag); } cout << flag << endl; return 0; }
#include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef long long ll; int main() { ll a, b, n; cin >> a >> b >> n; ll flag = -inf; /*for(ll i=1;i<=n;i++){ flag = max(res-ans,flag); } */ if (n < b) { cout << (a * n) / b << endl; return 0; } else { flag = max(a * ...
replace
10
14
10
23
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, n; cin >> a >> b >> n; long long int ans = INT_MIN; if (n < b) { ans = (a * n) / b; } else { long long int x = b - 1; long long int t; while (x <= n) { t = (a * x) / b - a * (x / b); ans = max(ans, t); ...
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, n; cin >> a >> b >> n; long long int ans = INT_MIN; if (n < b) { ans = (a * n) / b; } else { long long int x = b - 1; ans = (a * x) / b; } cout << ans; return 0; }
replace
11
17
11
12
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cstdint> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) const long long...
#include <algorithm> #include <bitset> #include <cstdint> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) const long long...
replace
35
36
35
36
TLE
p02696
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; #define PI 3.141592 #define MOD7 1000000007 #define LL_INF 9000000000000000000 #define LL_MINF -9000000000000000000 #define INT_INF 2000000000 #define INT_MINF -2000000000 #define all(a) (a)...
#pragma GCC optimize("Ofast") #include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; #define PI 3.141592 #define MOD7 1000000007 #define LL_INF 9000000000000000000 #define LL_MINF -9000000000000000000 #define INT_INF 2000000000 #define INT_MINF -2000000000 #define all(a) (a)...
replace
21
26
21
23
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; #define INF INT_MAX / 3 #define REP(i, n) for (int i = 0; i < n; i++) int main() { ll ...
#include <algorithm> #include <climits> #include <iostream> #include <map> #include <queue> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; #define INF INT_MAX / 3 #define REP(i, n) for (int i = 0; i < n; i++) int main() { ll ...
replace
21
23
21
25
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define pb push_back #define boostup \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); typedef long ...
#include <bits/stdc++.h> #define pb push_back #define boostup \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); typedef long ...
replace
11
21
11
16
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <numeric> #include <string> #include <vector> #define roop(i, n) for (int i = 0; i < n; i++) #define DIV 1000000007 using namespace std; using ll = long long int; using ull = unsigned long long; float myPower(...
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <numeric> #include <string> #include <vector> #define roop(i, n) for (int i = 0; i < n; i++) #define DIV 1000000007 using namespace std; using ll = long long int; using ull = unsigned long long; float myPower(...
replace
69
74
69
73
TLE
p02696
C++
Time Limit Exceeded
#include <iostream> int main() { unsigned long long A, B, N; std::cin >> A >> B >> N; const double dB = (double)B; const double dAB = A / dB; unsigned long long x = 0; unsigned long long max = 0; for (int i = 0; x < N; ++i) { x = B * (i + 1) - 1; x = x > N ? N : x; const unsigned long long...
#include <iostream> int main() { unsigned long long A, B, N; std::cin >> A >> B >> N; const double dB = (double)B; const double dAB = A / dB; unsigned long long x = 0; unsigned long long max = 0; for (int i = 0; x < N; ++i) { x = B * (i + 1) - 1; x = x > N ? N : x; const unsigned long long...
insert
20
20
20
22
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n, ans = 0; cin >> a >> b >> n; for (int x = 0; x <= n; x++) { long long left = a * x / b, right = x / b; ans = max(ans, left - a * right); if (right != 0) { break; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n, ans = 0; cin >> a >> b >> n; if (n < b) ans = a * n / b; else ans = a * (b - 1) / b; cout << ans << endl; return 0; }
replace
5
12
5
9
TLE
p02696
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = 100000000; #define rep1(i, n) for (ll i = 0; i < (n); i++) #define rep2(i, k, n) for (ll i = k; i < (n); i++) int main() { ll a, b, n; cin >> a >> b >> n; vector<ll> A(n, -1); ll ans = -1; A[0] = 0; r...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = 100000000; #define rep1(i, n) for (ll i = 0; i < (n); i++) #define rep2(i, k, n) for (ll i = k; i < (n); i++) int main() { ll a, b, n; cin >> a >> b >> n; ll ans = (a * (min(n, b - 1))) / b; cout << ans <...
replace
11
18
11
12
0
p02696
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long int #define M 1000000007 #define pb push_back #define pf push_front #define ulli unsigned long long int #define what_is(x) cerr << #x << " is " << x << endl; #define pi 2 * acos(0.0) #define F fi...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long int #define M 1000000007 #define pb push_back #define pf push_front #define ulli unsigned long long int #define what_is(x) cerr << #x << " is " << x << endl; #define pi 2 * acos(0.0) #define F fi...
replace
51
52
51
53
0
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; int main() { ll a, b, n; cin >> a >> b >> n; ll ans = 0; for (int i = 1; i <= n; i++) { ans = max(ans, ll(floor((a * i) / b) - a * floor(i / b))); } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; int main() { ll a, b, n; cin >> a >> b >> n; ll x = n < b ? n : b - 1; ll ans = floor((a * x) / b) - a * floor(x / b); cout << ans << endl; return 0; }
replace
9
13
9
11
TLE
p02696
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int A; int64_t B, N; cin >> A >> B >> N; int ans = 0; for (int64_t i = 1; i <= min(B, N); ++i) { int x = floor(A * i / B) - A * floor(i / B); if (x > ans) { ans = x; } } cout ...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int A; int64_t B, N; cin >> A >> B >> N; cout << floor(A * min(B - 1, N) / B) - A * floor(min(B - 1, N) / B) << endl; return 0; }
replace
8
16
8
9
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define endl '\n' #define all(s) s.begin(), s.end() #define lowbit(x) (x & -x) #define rep(i, a, n) for (int i = a; i <= n; i++) #define IOS ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define endl '\n' #define all(s) s.begin(), s.end() #define lowbit(x) (x & -x) #define rep(i, a, n) for (int i = a; i <= n; i++) #define IOS ...
replace
34
41
34
43
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
replace
405
407
405
407
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll a, b, n; cin >> a >> b >> n; ll ans = 0; for (ll x = 0; x <= n; x++) { if (x % b == 0) continue; ll l = (a * x) / b; ll r = a * (x / b); ans = max(ans, l - r); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll a, b, n; cin >> a >> b >> n; ll x = min(n, b - 1); cout << a * x / b - a * (x / b) << endl; return 0; }
replace
7
18
7
10
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, N, ans; cin >> A >> B >> N; ans = 0; for (int64_t i = N - B - 1; i <= N; i++) { int64_t x = A * i / B - A * (i / B); if (ans < x) { ans = x; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, N, ans; cin >> A >> B >> N; ans = 0; if (N < B) { ans = A * N / B; } else { ans = A * ((N / B * B) - 1) / B - A * (((N / B * B) - 1) / B); } cout << ans << endl; }
replace
7
12
7
11
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> // below comment for pbds #include <ext/pb_ds/assoc_container.hpp> // to use it make ordered_set #include <ext/pb_ds/tree_policy.hpp> // all set fnct + = 1. order_of_key(x); // number of #define ll long long // element strictly smaller than it; #define ld ...
#include <bits/stdc++.h> // below comment for pbds #include <ext/pb_ds/assoc_container.hpp> // to use it make ordered_set #include <ext/pb_ds/tree_policy.hpp> // all set fnct + = 1. order_of_key(x); // number of #define ll long long // element strictly smaller than it; #define ld ...
replace
40
42
40
41
TLE
p02696
C++
Time Limit Exceeded
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout << fixed << setprecision(10) #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #de...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout << fixed << setprecision(10) #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #de...
insert
127
127
127
130
TLE
p02696
C++
Time Limit Exceeded
/* auth - @sportykush */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef long double ld; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node...
/* auth - @sportykush */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef long double ld; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node...
replace
90
96
90
101
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; rep(i, n + 1) { ans = max(ans, a * i / b - a * (i / b)); } cout << ans << endl; return 0; }
#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; double low = 0; // 右側 double high = n + 1; auto f = [&](ll i) { return a * i / b - a * (i / b); }; int cnt = 10000; ...
replace
10
13
10
25
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) typedef long long ll; typedef pair<int, int> P; const int INF = 100100100; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; template <class T> inline bool chmax(T...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) typedef long long ll; typedef pair<int, int> P; const int INF = 100100100; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; template <class T> inline bool chmax(T...
replace
19
35
19
21
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <limits> #define ll long long #define F first #define S second #define pb push_back #define oo (1LL << 63 - 1) #define endl '\n' #define si size() #define all(v) v.begin(), v.end() #define FASTIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define Matrix vector<vector<long l...
#include <bits/stdc++.h> #include <limits> #define ll long long #define F first #define S second #define pb push_back #define oo (1LL << 63 - 1) #define endl '\n' #define si size() #define all(v) v.begin(), v.end() #define FASTIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define Matrix vector<vector<long l...
replace
25
31
25
27
TLE
p02696
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; const int INF = 1 << 30; const ll LLINF = 1LL << 60; int mod = 1000000007; int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); ll A, B, N; cin >> A >> B >> N; // A*x/B - x/B の最大値は...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; const int INF = 1 << 30; const ll LLINF = 1LL << 60; int mod = 1000000007; int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); ll A, B, N; cin >> A >> B >> N; // A*x/B - x/B の最大値は...
replace
24
34
24
25
0
p02696
C++
Time Limit Exceeded
// https://atcoder.jp/contests/abc165/tasks/abc165_d // 2020-05-02 #include <algorithm> #include <array> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { ...
// https://atcoder.jp/contests/abc165/tasks/abc165_d // 2020-05-02 #include <algorithm> #include <array> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { ...
replace
23
28
23
25
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; ll A, B, N; int main(void) { cin >> A >> B >> N; ll ans = 0; for (ll k = 0; k <= N; k++) { ll aa = (A * k) / B; ll ab = k / B; ...
#include <algorithm> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; ll A, B, N; int main(void) { cin >> A >> B >> N; ll ans = 0; ll m = min(B - 1, N); ans = (A * m) / B - A * (m / B); cout << ans << end...
replace
15
21
15
17
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; i++) using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; i++) using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { ...
replace
28
34
28
29
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; long long ans = 0; long long k = 0; while (k * (b - 1) <= n) { long long x = k * (b - 1); ans = max(ans, (a * x / b) - a * (x / b)); k++; } ans = max(ans, (a * n / b) - a * (n / b)); cout <<...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; long long ans = 0; // long long k = 0; // while(k*(b-1)<=n) { // long long x = k*(b-1); // ans = max(ans, (a*x/b)-a*(x/b)); // k++; // } long long k = n / b; long lon...
replace
10
16
10
20
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define RREP0(i, n) for (int i = (n)-1; i >= 0; --i) #define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define RREP1(i, n) for (int i...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define RREP0(i, n) for (int i = (n)-1; i >= 0; --i) #define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define RREP1(i, n) for (int i...
replace
20
25
20
23
TLE
p02696
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
replace
134
137
134
135
0
p02696
Python
Time Limit Exceeded
a, b, n = map(int, input().split()) ans = 0 # floor(a * x / b) # = floor(a * floor(x / b) + a * (x / b - floor(x / b))) # = a * floor(x / b) + floor(a * (x / b - floor(x / b)))) for i in range(min(b, n + 1)): ans = max(ans, int(a * i / b)) print(ans)
a, b, n = map(int, input().split()) ans = 0 # floor(a * x / b) # = floor(a * floor(x / b) + a * (x / b - floor(x / b))) # = a * floor(x / b) + floor(a * (x / b - floor(x / b)))) print(int(a * min(b - 1, n) / b))
replace
5
8
5
6
TLE
p02696
Python
Time Limit Exceeded
from sys import stdin, setrecursionlimit def main(): input = stdin.buffer.readline a, b, n = map(int, input().split()) ans = 0 for x in range(min(b, n + 1)): ans = max(int(a * x / b) - a * int(x / b), ans) print(ans) if __name__ == "__main__": setrecursionlimit(10000) main()
from sys import stdin, setrecursionlimit def main(): input = stdin.buffer.readline a, b, n = map(int, input().split()) ans = 0 x = min(b - 1, n) ans = max(int(a * x / b) - a * int(x / b), ans) print(ans) if __name__ == "__main__": setrecursionlimit(10000) main()
replace
9
11
9
11
TLE
p02696
Python
Runtime Error
def m(): a, b, n = map(int, input().split()) def calc(x): return int((a * x) / b) - (a * int(x / b)) if calc(1) < calc(n // 2): return max([calc(i) for i in range(n // 2, n + 1)]) else: return max([calc(i) for i in range(1, n // 2 + 1)]) print(m())
def m(): a, b, n = map(int, input().split()) def calc(x): return int((a * x) / b) - (a * int(x / b)) return calc(min(n, b - 1)) print(m())
replace
6
10
6
7
0
p02696
Python
Time Limit Exceeded
def main(): a, b, n = [int(x) for x in input().split()] gen = (a * x // b - x // b * a for x in range(min(b, n) + 1)) return max(gen) if __name__ == "__main__": print(main())
def main(): a, b, n = [int(x) for x in input().split()] # gen = (a * x // b - x // b * a for x in range(min(b, n) + 1)) if n >= b - 1: x = b - 1 else: x = n return a * x // b - x // b * a if __name__ == "__main__": print(main())
replace
2
4
2
10
TLE
p02696
Python
Time Limit Exceeded
A, B, N = map(int, input().split()) ans = 0 for i in range(1, N + 1): tmp = (A * i) // B - A * (i // B) ans = max(ans, tmp) print(ans)
A, B, N = map(int, input().split()) x = min(B - 1, N) ans = (A * x) // B - A * (x // B) print(ans)
replace
2
8
2
4
TLE
p02696
Python
Time Limit Exceeded
# def main(): a, b, n = map(int, input().split(" ")) fac = 0 for i in range(n + 1): j = i // b if j == 0: if fac < i: fac = i else: break ans = a * fac // b - a * (fac // b) print(ans) if __name__ == "__main__": main()
# def main(): a, b, n = map(int, input().split(" ")) fac = 0 start = min(b, n) if b <= n: fac = start - 1 else: fac = start ans = a * fac // b - a * (fac // b) print(ans) if __name__ == "__main__": main()
replace
6
13
6
11
TLE
p02696
Python
Runtime Error
a, b, n = map(int, input().split()) x = min(b.n) print(int(a * x / b))
a, b, n = map(int, input().split()) x = min(b - 1, n) ans = int(a * x / b) # if a == 1 or b == 1 or b == n: # print(0) # else: print(ans)
replace
2
4
2
9
AttributeError: 'int' object has no attribute 'n'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02696/Python/s868471996.py", line 3, in <module> x = min(b. n) AttributeError: 'int' object has no attribute 'n'
p02696
Python
Time Limit Exceeded
def f(x): return (a * x) // b - a * (x // b) a, b, n = map(int, input().split()) k = (n + 1) // b ans = 0 for x in range(max(0, k * b - 1), n + 1): ans = max(ans, f(x)) print(ans)
def f(x): return (a * x) // b - a * (x // b) a, b, n = map(int, input().split()) k = (n + 1) // b x = max(k * b - 1, 0) ans = f(x) ans = max(ans, f(n)) print(ans)
replace
8
12
8
11
TLE
p02696
Python
Time Limit Exceeded
import math A, B, N = map(int, input().split(" ")) ans = 0 for x in range(min(B, N + 1)): res = math.floor((A * x) / B) - A * (math.floor(x / B)) ans = max(res, ans) print(int(ans))
import math A, B, N = map(int, input().split(" ")) ans = 0 x = min(B, N + 1) - 1 ans = math.floor((A * x) / B) - A * (math.floor(x / B)) print(int(ans))
replace
4
7
4
6
TLE
p02696
Python
Time Limit Exceeded
a, b, n = map(int, input().split()) ans = 0 if b > n: x = n ans = int(a * x // b) - int(a * (x // b)) else: m = 0 for i in range(b): if int(a * (n - i) // b) - int(a * ((n - i) // b)) > m: m = int(a * (n - i) // b) - int(a * ((n - i) // b)) ans = m print(ans)
a, b, n = map(int, input().split()) ans = 0 if b > n: x = n ans = int(a * x // b) - int(a * (x // b)) else: x = n ans1 = int(a * x // b) - int(a * (x // b)) x = (n // b) * b - 1 ans2 = int(a * x // b) - int(a * (x // b)) ans = max(ans1, ans2) print(ans)
replace
7
12
7
12
TLE
p02696
Python
Runtime Error
from math import floor A, B, N = list(map(int, input().split())) # print(A, B, N) x = None if N < B: x = N answer = floor(A * x / B) - A * floor(x / B) print(answer)
from math import floor A, B, N = list(map(int, input().split())) # print(A, B, N) x = None if N < B: x = N else: x = B x = B - 1 # max_diff = 0 # for _x in range(B, N + 1): # diff = (x / B) - floor(x / B) # if max_diff <= diff: # max_diff = diff # x = _x an...
insert
8
8
8
17
0
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, c, n, i, m = 0, d; cin >> a >> b >> n; for (i = 1; i <= n; i++) { c = ((a * i) / b) - (a * (i / b)); if (m <= c) { m = c; d = i; } } cout << m << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, c, n, i, m = 0, d; cin >> a >> b >> n; m = min(b - 1, n); d = (a * m) / b - (a * (m / b)); cout << d << endl; }
replace
5
13
5
8
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; long max = 0; for (int i = 1; i < b && i <= n; i++) { long k = a * i / b; if (max < k) max = k; } cout << max << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; long long i = min(b - 1, n); long long max = a * i / b; cout << max << endl; }
replace
5
11
5
7
TLE
p02696
C++
Time Limit Exceeded
#include <iostream> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (ll i = ll(a); i <= ll(b); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) using namespace std; using ll = long long; int main() { ll a, b, n; cin >> a >> b >> n; ll max = 0; if (b < n...
#include <iostream> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (ll i = ll(a); i <= ll(b); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) using namespace std; using ll = long long; int main() { ll a, b, n; cin >> a >> b >> n; ll max = 0; ll x = (n...
replace
15
32
15
25
TLE
p02696
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeri...
// #include <bits/stdc++.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeri...
replace
37
44
37
39
TLE
p02696
C++
Time Limit Exceeded
/* !!!!!! !!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!! ...
/* !!!!!! !!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!! ...
replace
119
122
119
122
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace ...
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace ...
replace
102
108
102
106
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int64_t A, B, N; cin >> A >> B >> N; int64_t ans = -999999999; for (int i = 1; i <= N; i++) { int64_t x = floor(A * i / B) - A * floor(i / B); ans = max(ans, x); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int64_t A, B, N; cin >> A >> B >> N; int64_t x = min(B - 1, N); int64_t ans = floor(A * x / B); cout << ans << endl; }
replace
7
12
7
9
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #define mp make_pair #define pb push_back #define ll long long int #define ld long double #define fi first #define se second #define mod 1000000007 #define test \ long long int t; ...
#include <algorithm> #include <bits/stdc++.h> #define mp make_pair #define pb push_back #define ll long long int #define ld long double #define fi first #define se second #define mod 1000000007 #define test \ long long int t; ...
replace
65
66
65
71
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> long long int a; long long int b; long long int n; using namespace std; int main() { cin >> a; cin >> b; cin >> n; long long int m = 0; for (long long int x = 0; x <= n; x++) { long long int t = ((a * x) / b) - a * (x / b); if (t > m) { m = t; } } cout << m; }
#include <bits/stdc++.h> long long int a; long long int b; long long int n; using namespace std; int main() { cin >> a; cin >> b; cin >> n; long long int m = 0; /* for(long long int x=0;x<=n;x++){ long long int t=((a*x)/b)-a*(x/b); if(t>m){ m=t; } }*/ if (b <= n) { long...
replace
12
13
12
47
TLE
p02696
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
replace
293
294
293
295
0
p02696
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <math.h> #include <time.h> using namespace std; const long long mod = 1000000007; #define ll long long #define P pair<int, int> #define dump(x) \ if (dbg) { ...
#include "bits/stdc++.h" #include <math.h> #include <time.h> using namespace std; const long long mod = 1000000007; #define ll long long #define P pair<int, int> #define dump(x) \ if (dbg) { ...
replace
28
42
28
31
TLE
p02696
Python
Time Limit Exceeded
import sys sys.setrecursionlimit(10**6) INF = float("inf") MOD = 10**9 + 7 def input(): return sys.stdin.readline().strip() def main(): A, B, N = map(int, input().split()) def func(x): res = (A * x) // B - A * (x // B) return res M = 0 for i in range(N, max(0, N - 10**7), -1)...
import sys sys.setrecursionlimit(10**6) INF = float("inf") MOD = 10**9 + 7 def input(): return sys.stdin.readline().strip() def main(): A, B, N = map(int, input().split()) def func(x): res = (A * x) // B - A * (x // B) return res print(func(min(N, B - 1))) if __name__ == "__mai...
replace
19
26
19
20
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; long long a, b, n; int main() { cin >> a >> b >> n; n = min(n, b); long long bsr = 0; for (int i = 1; i <= n; i++) { bsr = max(bsr, (a * i) / b - a * (i / b)); } cout << bsr << endl; }
#include <bits/stdc++.h> using namespace std; long long a, b, n; int main() { cin >> a >> b >> n; if (n < b) cout << (a * n) / b << endl; else cout << (a * (b - 1)) / b << endl; }
replace
7
13
7
11
TLE
p02696
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for ((i) = 0; (i) < (int)(n); (i)++) #define ll long long using namespace std; ll i, j, k; const ll MOD = 1000000000 + 7; ll gcd(ll a, ll b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } ll lcm(ll a, ll ...
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for ((i) = 0; (i) < (int)(n); (i)++) #define ll long long using namespace std; ll i, j, k; const ll MOD = 1000000000 + 7; ll gcd(ll a, ll b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } ll lcm(ll a, ll ...
replace
24
45
24
25
0
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> using namespace std; void Main() { // input u_int64_t A, B, N; cin >> A >> B >> N; // translate u_int64_t ans = 0; if (N < B) { cout << (A * N) / B << endl; return; } for (u_int64_t x = B - 1; x <= N; x += B) { u_int64_t num = (...
#include <algorithm> #include <iomanip> #include <iostream> using namespace std; void Main() { // input u_int64_t A, B, N; cin >> A >> B >> N; // translate u_int64_t ans = 0; if (B == 1) { cout << 0 << endl; return; } if (N < B) { cout << (A * N) / B << endl; return; } for (u_in...
insert
13
13
13
18
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; long long max = 0; for (long long x = 1; x <= n; x++) { long long v = ((a * x) / b) - (a * (x / b)); if (v > max) { max = v; } } cout << max; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; long long x = n < b - 1 ? n : b - 1; cout << (a * x) / b - a * (x / b); return 0; }
replace
7
16
7
9
TLE
p02696
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> // #include <boost...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> // #include <boost...
replace
83
92
83
84
TLE
p02696
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using ll = long long; int main() { long long int a, b, n; cin >> a >> b >> n; int maxv = 0; if (n <= b) { long long int A, B; for (int i = ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using ll = long long; int main() { long long int a, b, n; cin >> a >> b >> n; int maxv = 0; if (n < b) { // n<=bってことは[x/b]=0こていなのでAxがクソでかいほうがいい...
replace
12
19
12
23
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 = 1; i <= n; ++i) { ans = max(ans, ll(floor(a * i / b) - a * floor(i / b))); } cout << ans <<...
#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 i = min(b - 1, n); ll ans = ll(floor(a * i / b) - a * floor(i / b)); cout << ans << endl; return 0; }
replace
9
13
9
11
TLE