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 <bits/stdc++.h>
#include <cmath>
#include <math.h>
using namespace std;
#define ll long long
int main() {
ll A, B, N;
cin >> A;
cin >> B;
cin >> N;
ll max = 0;
for (ll x = 0; x <= N; x++) {
if (max < (A * x / B) / 1 - A * ((x / B) / 1)) {
max = (A * x / B) / 1 - A * ((x / B) / 1);
... | #include <bits/stdc++.h>
#include <cmath>
#include <math.h>
using namespace std;
#define ll long long
int main() {
ll A, B, N;
cin >> A;
cin >> B;
cin >> N;
ll max = 0;
if (B > N) {
max = (A * N / B) / 1 - A * ((N / B) / 1);
} else {
max = (A * (B - 1) / B) / 1 - A * (((B - 1) / B) / 1);
}
... | replace | 14 | 18 | 14 | 18 | 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 all(v) v.begin(), v.end()
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long ans = 0;
long long NN = min(B, N);
for (int i = 0; i <= NN; i++) {
long long C = A * i;
long long D = C / B... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long ans = 0;
long long NN = min(B - 1, N);
long long C = A * NN;
long long D = C / B;
long long E = NN / B;
ans =... | replace | 8 | 15 | 8 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | // #pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
// #pragma GCC target("avx,avx2,fma")
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>... | // #pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
// #pragma GCC target("avx,avx2,fma")
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>... | replace | 59 | 66 | 59 | 61 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll a, b, n;
cin >> a >> b >> n;
ll max = 0;
ll ans = 0;
ll lol = 0;
for (int i = 0; i <= n; i++) {
ans = (a * i) / b - a * (i / b);
if (ans > max) {
max = a... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll a, b, n;
cin >> a >> b >> n;
ll max = 0;
ll ans = 0;
ll lol = 0;
ll x = min(b - 1, n);
max = (a * x) / b - a * (x / b);
cout << max << endl;
return 0;
} | replace | 12 | 18 | 12 | 14 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define GO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define int lon... | #include <bits/stdc++.h>
using namespace std;
#define GO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define int lon... | replace | 16 | 20 | 16 | 26 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long maxi = 0;
for (int i = 0; i <= n; i++) {
maxi = max(maxi, (i % b));
}
cout << a * maxi / b << endl;
} | #include <iostream>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
if (n >= b)
cout << a * (b - 1) / b << endl;
else
cout << a * n / b << endl; // n < b
} | replace | 7 | 13 | 7 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define ar array
#define nl '\n'
#define AC \
ios_base::sync_with_stdio(0); \
cin.tie(NULL);
using namespace std;
const int M = 1e9 + 7;
const int N = 2 * ... | #include <bits/stdc++.h>
#define ll long long
#define ar array
#define nl '\n'
#define AC \
ios_base::sync_with_stdio(0); \
cin.tie(NULL);
using namespace std;
const int M = 1e9 + 7;
const int N = 2 * ... | replace | 16 | 26 | 16 | 23 | TLE | |
p02696 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
ll A, B, N;
std::cin >> A, B, N;
ll maxX = std::min(B - 1, N);
std::cout << A * (maxX) / B;
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main() {
ll A, B, N;
std::cin >> A >> B >> N;
ll maxX = std::min<ll>(B - 1, N);
std::cout << A * (maxX) / B;
return 0;
}
| replace | 7 | 9 | 7 | 10 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
int main() {
long long A, B, N;
std::cin >> A >> B >> N;
if (N < B) {
long long ans = A * N / B;
std::cout << ans << std::endl;
} else {
long long max = 0;
for (long long i = A - 1; i < A * B; i += A) {
long long tmp = A * i / B - A * (long long)(i / B);
ma... | #include <bits/stdc++.h>
int main() {
long long A, B, N;
std::cin >> A >> B >> N;
if (N < B) {
long long ans = A * N / B;
std::cout << ans << std::endl;
} else {
long long x = B - 1;
long long ans = A * x / B - A * (long long)(x / B);
std::cout << ans << std::endl;
}
return 0;
}
| replace | 10 | 16 | 10 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <stdio.h>
long long n, m, i, j, k, a, b;
int main() {
scanf("%lld%lld%lld", &a, &b, &n);
for (i = 0; i <= n; i++) {
if (a * i / b - a * (i / b) > m) {
m = a * i / b - a * (i / b);
k = i;
}
}
printf("%lld\n", m);
return 0;
} | #include <stdio.h>
long long n, m, i, j, k, a, b;
int main() {
scanf("%lld%lld%lld", &a, &b, &n);
if (n >= b)
n = b - 1;
printf("%lld\n", a * n / b - a * (n / b));
return 0;
} | replace | 4 | 11 | 4 | 7 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(void) {
ll A, B, N;
cin >> A >> B >> N;
ll c = 0;
for (ll i = 0; i <= N; i++) {
c = max(c, (A * i) / B - A * (i / B));
}
cout << c;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(void) {
ll A, B, N;
cin >> A >> B >> N;
ll c = 0;
if (B <= N) {
c = (A * (B - 1)) / B - A * ((B - 1) / B);
} else {
c = (A * N) / B - A * (N / B);
}
cout << c;
return 0;
} | replace | 12 | 14 | 12 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
typedef long long ll;
inline void up(ll &x, ll y) { x < y ? x = y : 0; }
int main() {
ll a, b, n, ans = 0;
std::cin >> a >> b >> n;
for (ll x = 1; x <= n; ++x)
up(ans, (a * x) / b - a * (x / b));
std::cout << ans << '\n';
return 0;
}
| #include <bits/stdc++.h>
typedef long long ll;
inline void up(ll &x, ll y) { x < y ? x = y : 0; }
int main() {
ll a, b, n, ans = 0;
std::cin >> a >> b >> n;
if (b - 1 <= n)
std::cout << a * (b - 1) / b - a * ((b - 1) / b) << '\n';
else
std::cout << a * n / b - a * (n / b) << '\n';
return 0;
}
| replace | 8 | 11 | 8 | 12 | 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 < (int)(n); i++)
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = -10000100;
for (ll x = 0; x <= n; x++) {
ll f = (a * x) / b - a * (x / b);
ans = max(ans, f);
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans;
if (b > n) {
ans = (a * n) / b - a * (n / b);
} else {
ans = (a * (b - 1)) / b - a * ((b - 1) / b);
}
cout << ans << endl;
... | replace | 8 | 12 | 8 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
ll ans, mx, mn, flag, sum, cnt;
int main() {
ll a, b, n;
cin >> a >> b >> n;
for (ll i = 1; i <= n; i++) {
... | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
ll ans, mx, mn, flag, sum, cnt;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll mn = min(b - 1, n);
cout << ... | replace | 17 | 26 | 17 | 19 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define space " "
#define MOD (long long)1000000007
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename T> void __f(const char *variable_name, T &&value) {
cout << variable_name << ": " << value << endl;
}
template <typename T1, typen... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define space " "
#define MOD (long long)1000000007
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename T> void __f(const char *variable_name, T &&value) {
cout << variable_name << ": " << value << endl;
}
template <typename T1, typen... | replace | 22 | 32 | 22 | 33 | TLE | |
p02696 | C++ | Runtime Error | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i, n) for (ll i = 0; i < n; i++)
#define Loop(i, m, n) for (ll i = m; i < n; i++)
#define pool(i, n) for (ll i = n; i >= 0; i--)
... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i, n) for (ll i = 0; i < n; i++)
#define Loop(i, m, n) for (ll i = m; i < n; i++)
#define pool(i, n) for (ll i = n; i >= 0; i--)
... | replace | 69 | 105 | 69 | 73 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < (N); i++)
#define repo(i, N) for (int i = 1; i < (N); i++)
#define pb push_back
#define mp make_pair
#define ll long long
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
// #define num 1000000007
#define pi acos... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < (N); i++)
#define repo(i, N) for (int i = 1; i < (N); i++)
#define pb push_back
#define mp make_pair
#define ll long long
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
// #define num 1000000007
#define pi acos... | replace | 26 | 31 | 26 | 33 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repa(i, s, n) for (int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
typedef pair<int, int> P;
#define rrep(i, a, b) for (int i = a; i >= b; i--)
signed main() {
int ... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repa(i, s, n) for (int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
typedef pair<int, int> P;
#define rrep(i, a, b) for (int i = a; i >= b; i--)
signed main() {
int ... | replace | 14 | 20 | 14 | 16 | TLE | |
p02696 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define itn int
int main(void) {
long long a, b, n;
cin >> a >> b >> n;
long long ans = (a * (n) / b) - a * ((n) / b);
for (long long int i = 0; i <= n / (b - 1); i++) {
long long sum1 = (a * ((b - 1) * i)) / b;
long long sum2 = a * (((b - 1) * i) / b);
... | #include <bits/stdc++.h>
using namespace std;
#define itn int
int main(void) {
long long a, b, n;
cin >> a >> b >> n;
long long ans = (a * n / b) - a * (n / b);
if (b - 1 <= n) {
ans = max(ans, (a * (b - 1) / b) - a * ((b - 1) / b));
}
cout << ans << endl;
} | replace | 8 | 14 | 8 | 11 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
double a, b, n, ans = 0;
cin >> a >> b >> n;
for (double i = 1; i <= min(n, b); i++) {
ans = max(ans, (floor(a * i / b) - a * floor(i / b)));
}
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
double a, b, n, ans = 0;
cin >> a >> b >> n;
if (b - 1 < n)
ans = floor(a * (b - 1) / b);
else
ans = floor(a * n / b);
cout << ans << endl;
} | replace | 6 | 9 | 6 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define REP(i, x, n) for (int i = x; i < (int)n; i++)
#define rep(i, n) REP(i, 0, n)
#define sp(p) cout << setprecision(16) << fixed << p << endl;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, x, n) for (int i = x; i < (int)n; i++)
#define rep(i, n) REP(i, 0, n)
#define sp(p) cout << setprecision(16) << fixed << p << endl;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(... | replace | 109 | 110 | 109 | 110 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define f(i, j, k) for (int i = j; i < k; i++)
using namespace std;
int main() {
long long a, b, c, ans = 0, j;
cin >> a >> b >> c;
j = c / b;
f(i, 1, j + 1) {
if (ans < floor(a * (b * i - 1) / b) - a * floor((b * i - 1) / b)) {
ans = floor(a * (b * i - 1) / b) - a * floor((b... | #include <bits/stdc++.h>
#define f(i, j, k) for (int i = j; i < k; i++)
using namespace std;
int main() {
long long a, b, c, ans = 0, j;
cin >> a >> b >> c;
j = c / b;
if (b == 1) {
cout << 0 << endl;
return 0;
}
f(i, 1, j + 1) {
if (ans < floor(a * (b * i - 1) / b) - a * floor((b * i - 1) / b))... | replace | 7 | 8 | 7 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#pragma region Macros
#define int long long
#define double long double
constexpr int MOD = 1000000007;
constexpr double PI = 3.1415926535897... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#pragma region Macros
#define int long long
#define double long double
constexpr int MOD = 1000000007;
constexpr double PI = 3.1415926535897... | replace | 186 | 191 | 186 | 191 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = (int)(n)-1; 0 <= i; i--)
#define rrep1(i, n) for (int i = (int)(n); 1 <= i; i--)
#define each(it, c) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = (int)(n)-1; 0 <= i; i--)
#define rrep1(i, n) for (int i = (int)(n); 1 <= i; i--)
#define each(it, c) ... | replace | 46 | 52 | 46 | 47 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
const ll INF = 999999999999999;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = 0;
ll cnt = 0;
while (true) {
ans = max((ll)(a * n / b) - a * (ll)(n / b), ans... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
const ll INF = 999999999999999;
int main() {
ll a, b, n;
cin >> a >> b >> n;
n = min(n, b - 1);
cout << (a * n - a * n % b) / b - a * (n - n % b) / b;
return 0;
}
| replace | 10 | 20 | 10 | 13 | 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 = 0, y = min(b - 1, n);
vector<int> ans;
while (((a * x) / b) - (a * (x / b)) < a && x <= y) {
ans.push_back(((a * x) / b) - (a * (x / b)));
x++;
}
sort(ans.begin(), ans.end());
reverse(... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long x = min(n, b - 1);
cout << ((a * (x % b)) - ((a * (x % b)) % b)) / b << endl;
return 0;
} | replace | 5 | 14 | 5 | 7 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
/* ॐ Shree ॐ */
/* ॐ ॐ ॐ
ॐ भूर् भुवः स्वः
तत् सवितुर्वरेण्यं
भर्गो देवस्य धीमहि
धियो यो नः प्रचोदयात्
*/
using namespace std;
typedef long long int ll;
vector<int> ve(3006, 0);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(N... | #include <bits/stdc++.h>
/* ॐ Shree ॐ */
/* ॐ ॐ ॐ
ॐ भूर् भुवः स्वः
तत् सवितुर्वरेण्यं
भर्गो देवस्य धीमहि
धियो यो नः प्रचोदयात्
*/
using namespace std;
typedef long long int ll;
vector<int> ve(3006, 0);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(N... | replace | 25 | 30 | 25 | 28 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = -1;
for (long long i = 0; i < n + 1; i++) {
ans = max(ans, a * i / b - (i / b) * a);
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = -1;
if (n < b - 1) {
ans = a * n / b;
} else {
ans = a * (b - 1) / b;
}
cout << ans << endl;
}
| replace | 8 | 10 | 8 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main() {
unsigned long long a, b;
long long max = -9999999;
unsigned long long n;
int h;
cin >> a >> b >> n;
for (int i = 0; i <= n / b; i++) {
h = i;
}
for (int i = 0; i < h; i++) {... | #include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main() {
unsigned long long a, b;
long long max = -9999999;
unsigned long long n;
int h;
cin >> a >> b >> n;
for (int i = 0; i <= n / b; i++) {
h = i;
}
if (h > 0) {
for (int i =... | replace | 15 | 18 | 15 | 20 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
// #define print(ele) cout << (ele) << "\n"
#define pr... | #include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
// #define print(ele) cout << (ele) << "\n"
#define pr... | replace | 31 | 39 | 31 | 35 | 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 max = 0;
ll x;
if (n >= b) {
x = b - 1;
} else {
x = n;
}
while (x <= n) {
ll Ax = a * x;
ll val... | #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 max = 0;
ll x;
if (n >= b) {
x = b - 1;
} else {
x = n;
}
while (x <= n) {
ll Ax = a * x;
ll val... | replace | 23 | 24 | 23 | 24 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define sort(s) sort(s.begin(), s.end())
#define reverse(s) reverse(s.begin(), s.end())
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
const ll mod = 1e9 + 7;
// 最大公約数
ll gcd(ll a, ll b) { return b ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define sort(s) sort(s.begin(), s.end())
#define reverse(s) reverse(s.begin(), s.end())
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
const ll mod = 1e9 + 7;
// 最大公約数
ll gcd(ll a, ll b) { return b ... | replace | 98 | 103 | 98 | 101 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#define ll long long
using namespace std;
int main()
{
ll a, b, n;
cin >> a >> b >> n;
if (b == 1) {
cout << 0 << endl;
return 0;
}
ll ans = -1e18;
n = min(n, b - 1);
for (int i = 0; i <= n; i++) {
ans = max(ans, (a * i) / b - a * (... | #include <algorithm>
#include <cstdio>
#include <iostream>
#define ll long long
using namespace std;
int main()
{
ll a, b, n;
cin >> a >> b >> n;
if (b == 1) {
cout << 0 << endl;
return 0;
}
ll ans = -1e18;
n = min(n, b - 1);
ans = max(ans, (a * n) / b - a * (n / b));
cout << ans << endl;
... | replace | 18 | 21 | 18 | 21 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
// using namespace std;
using std::cin, std::cout, std::endl, std::string;
using ll = long long;
#define rep(countName, le... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
// using namespace std;
using std::cin, std::cout, std::endl, std::string;
using ll = long long;
#define rep(countName, le... | replace | 26 | 30 | 26 | 28 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
// #include <boost/array.hpp>
// #include <boost/range/numeric.hpp>
// #include <boost/range/algorithm.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
// using ... | #include <bits/stdc++.h>
// #include <boost/array.hpp>
// #include <boost/range/numeric.hpp>
// #include <boost/range/algorithm.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
// using ... | delete | 65 | 69 | 65 | 65 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
#define REP(i, n) for (int i = 0; i < (n); i++)
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;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, n;
cin >> a... | #include <cmath>
#include <iostream>
#define REP(i, n) for (int i = 0; i < (n); i++)
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;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, n;
cin >> a... | replace | 20 | 25 | 20 | 27 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef long double ld;
const ll INF = (ll)1e18;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF ll(1e18)
#define MOD 1000000007
#define print(a) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef long double ld;
const ll INF = (ll)1e18;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF ll(1e18)
#define MOD 1000000007
#define print(a) ... | replace | 28 | 35 | 28 | 30 | TLE | |
p02696 | C++ | Time Limit Exceeded | // I'm a f*cking looser
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fasino \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define asc(A) sort(A.begin(), A.end())
#define dsc(A... | // I'm a f*cking looser
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fasino \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define asc(A) sort(A.begin(), A.end())
#define dsc(A... | replace | 21 | 26 | 21 | 34 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
#define sp(x) cout << setprecision(x);
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX * 0.99
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define yes "Yes"
#define no "No"
#def... | #include "bits/stdc++.h"
using namespace std;
#define sp(x) cout << setprecision(x);
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX * 0.99
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define yes "Yes"
#define no "No"
#def... | replace | 31 | 32 | 31 | 39 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c;
cin >> a >> b >> c;
long long maxn = -999999;
for (long long i = 0; i < c / 2; i++) {
long long k = (a * i) / b - a * (i / b);
maxn = max(maxn, k);
}
for (long long i = c / 2; i <= c; i++) {
long long k = (a * i) / b -... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> x;
long long n = min(b - 1, x);
cout << (a * n) / b - a * (n / b);
return 0;
}
| replace | 3 | 15 | 3 | 7 | TLE | |
p02696 | C++ | Time Limit Exceeded | /*
* author :Sadik Hassan
*
*/
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define nl "\n"
#define pb push_back
#define fi first
#define se second
#define PI (acos(-1.0))
#define _SAD() ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define repp(i, a, n) for (int i = a; i < n; i++)
#define ... | /*
* author :Sadik Hassan
*
*/
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define nl "\n"
#define pb push_back
#define fi first
#define se second
#define PI (acos(-1.0))
#define _SAD() ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define repp(i, a, n) for (int i = a; i < n; i++)
#define ... | replace | 39 | 56 | 39 | 41 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1ll << 60;
ll A, B, N;
inline ll f(ll n) { return ((A * n) / B) - A * (n / B); }
int main(int argc, char **argv) {
cin >> A >> B >> N;
ll res{0};
for (ll i = N / 2; i <= N; ++i) {
res = max... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1ll << 60;
ll A, B, N;
inline ll f(ll n) { return ((A * n) / B) - A * (n / B); }
int main(int argc, char **argv) {
cin >> A >> B >> N;
std::cout << f(min(N, B - 1)) << std::endl;
} | replace | 12 | 17 | 12 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
#define each(i, mp) for (auto &i : mp)
int main() {
long double a, b, n;
cin >> a >> b >> n;
ll ans = 0;
ll tmp ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
#define each(i, mp) for (auto &i : mp)
int main() {
long double a, b, n;
cin >> a >> b >> n;
ll ans = 0;
ll tmp ... | replace | 17 | 27 | 17 | 30 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
long long A, B, N, max = 0;
cin >> A >> B >> N;
for (long long x = N; x >= 0; x -= 1) {
long long Ax = A * x;
long long res = Ax / B - A * (x / B);
if (res > max)
max = res;
}
cout << max << endl;
} | #include <iostream>
using namespace std;
int main() {
long long A, B, N, max = 0;
cin >> A >> B >> N;
long long x = 0;
if (N >= B)
x = B - 1;
else
x = N;
long long res = (A * x) / B;
cout << res << endl;
} | replace | 5 | 12 | 5 | 16 | 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 < n; i++)
const ll INF = 1001001001;
const double PI = 3.141592653;
const ll MOD = 1000000007; // 大きい素数
// 提出のときに言語がc++似合っていることを確認する
// 絶対値の関数
int z(int a, int b) {
if (a > b)
return a - b;
else
retur... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < n; i++)
const ll INF = 1001001001;
const double PI = 3.141592653;
const ll MOD = 1000000007; // 大きい素数
// 提出のときに言語がc++似合っていることを確認する
// 絶対値の関数
int z(int a, int b) {
if (a > b)
return a - b;
else
retur... | replace | 24 | 28 | 24 | 26 | TLE | |
p02696 | C++ | Time Limit Exceeded | #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;
template <class T>
using oset =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pb push_back
#define N 200001
#define ll long l... | #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;
template <class T>
using oset =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pb push_back
#define N 200001
#define ll long l... | replace | 100 | 101 | 100 | 101 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int 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 SZ(x) ((int)(x).size())
typedef vector<int> VI;... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int 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 SZ(x) ((int)(x).size())
typedef vector<int> VI;... | replace | 37 | 43 | 37 | 39 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, mx = 0;
cin >> a >> b >> n;
for (int i = 1; i * b - 1 <= n; i++) {
long long t = i * b - 1;
mx = max(mx, (a * t / b) - a * (t / b));
}
long long t = n;
mx = max(mx, (a * t / b) - a * (t / b));
cout << mx << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, mx = 0;
cin >> a >> b >> n;
if (b == 1) {
cout << 0 << endl;
return 0;
}
for (int i = 1; i * b - 1 <= n; i++) {
long long t = i * b - 1;
mx = max(mx, (a * t / b) - a * (t / b));
}
long long t = n;
mx = max(mx... | insert | 7 | 7 | 7 | 11 | TLE | |
p02696 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define big ((ll)(1e9) + 7)
int main() {
ll a, b, n;
cin >> a >> b >> n;
vector<ull> ans(n);
for (ll ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define big ((ll)(1e9) + 7)
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x = min(n, b - 1);
cout <... | replace | 18 | 24 | 18 | 20 | 0 | |
p02696 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long INT;
double PI = 3.14159265;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<string>;
using DGraph = vector<vector<pair<int, int>>>;
const long long INF = 1LL << 60;
//---//
int main() {
INT a, b, n... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long INT;
double PI = 3.14159265;
using namespace std;
using Graph = vector<vector<int>>;
using Field = vector<string>;
using DGraph = vector<vector<pair<int, int>>>;
const long long INF = 1LL << 60;
//---//
int main() {
INT a, b, n... | replace | 16 | 19 | 16 | 23 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long int a, b, n, i, max = 0, temp = 0;
cin >> a >> b >> n;
for (i = 1; ((i <= n) && (i <= b)); i++) {
temp = floor(a * i / b) - a * floor(i / b);
if (temp > max)
max = temp;
if (temp < max)
break;
}
cout << ma... | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long int a, b, n, i, max = 0, temp = 0;
cin >> a >> b >> n;
if (b - 1 <= n)
max = floor((b - 1) * a / b) - a * floor((b - 1) / b);
else
max = floor(n * a / b) - a * floor(n / b);
cout << max << endl;
return 0;
}
| replace | 6 | 13 | 6 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define lld long long
#define pi pair<int, int>
#define pl pair<lld, lld>
#define mem0(x) memset(x, 0, sizeof(x))
#define fillnum(x, n) fill(begin(x), end(x), n)
#define asort(x) sort(x.begin(), x.end())
#define dsort(x, t) sort(x.begin(), x.end(), greater<t>())
int main(... | #include <bits/stdc++.h>
using namespace std;
#define lld long long
#define pi pair<int, int>
#define pl pair<lld, lld>
#define mem0(x) memset(x, 0, sizeof(x))
#define fillnum(x, n) fill(begin(x), end(x), n)
#define asort(x) sort(x.begin(), x.end())
#define dsort(x, t) sort(x.begin(), x.end(), greater<t>())
int main(... | replace | 15 | 16 | 15 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using P = pair<ll, ll>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll sum = 0, ans = 0;
for (int i = 0; i <= n; i++) {
sum = (a * i) / b - a * (i / b);
ans = max(sum, ans);
}
cout << ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using P = pair<ll, ll>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = 0;
if (n < b) {
cout << a * n / b << endl;
return 0;
} else {
ans = (a * n) / b - a * (n / b);
ans = ... | replace | 9 | 13 | 9 | 17 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <iostream>
int main(int argc, const char *argv[]) {
long long int a, b, n, c;
c = 0;
std::cin >> a >> b >> n;
if (b > n) {
std::cout << a * n / b - a * (n / b) << std::endl;
} else {
for (int i = 1; i * b - 1 < n; i++) {
c = i * b - 1;
}
std::cout << a * c / b - a * (c / b) << ... | #include <iostream>
int main(int argc, const char *argv[]) {
long long int a, b, n, c;
c = 0;
std::cin >> a >> b >> n;
if (b > n) {
std::cout << a * n / b - a * (n / b) << std::endl;
} else {
c = (n / b) * b - 1;
std::cout << a * c / b - a * (c / b) << std::endl;
}
return 0;
}
| replace | 9 | 12 | 9 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | // #pragma GCC optimize("Ofast,unroll-all-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define len(v) ((int)(v).size())
#define pb push_back
#define kek pop_back
#define pii pair<int, int>
#defin... | // #pragma GCC optimize("Ofast,unroll-all-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define len(v) ((int)(v).size())
#define pb push_back
#define kek pop_back
#define pii pair<int, int>
#defin... | replace | 77 | 78 | 77 | 78 | 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 ans = 0;
for (ll i = 1; i <= min(n, b); i++) {
ll tmp = (a * i) / b - a * (i / b);
ans = max(ans, tmp);
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
cout << a * min(b - 1, n) / b << endl;
return 0;
} | replace | 7 | 13 | 7 | 8 | TLE | |
p02696 | C++ | Time Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
using ... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
using ... | replace | 45 | 46 | 45 | 46 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a, b, n;
cin >> a >> b >> n;
int64_t x, maxi = 0;
for (x = 0; x <= n; x++) {
int64_t p = x / b;
int64_t ans = a * x / b - a * p;
maxi = max(ans, maxi);
}
cout << maxi;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a, b, n;
cin >> a >> b >> n;
int64_t x, maxi = 0;
int64_t p = min(b - 1, n);
int64_t q = p / b;
int64_t ans = a * p / b - a * q;
cout << ans;
} | replace | 6 | 12 | 6 | 10 | 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 rep1(i, n) for (int i = 1; i < n + 1; i++)
#define sort(A) sort(A.begin(), A.end())
#define reverse(A) reverse(A.begin(), A.end());
typedef long long ll;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = 0;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define sort(A) sort(A.begin(), A.end())
#define reverse(A) reverse(A.begin(), A.end());
typedef long long ll;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans = 0;
... | replace | 12 | 14 | 12 | 18 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const long INF = 1L << 60;
int main() {
long a, b, n;
scanf("%ld%ld%ld", &a, &b, &n);
long ans = -INF;
for (int i = n / 2; i <= n; i++)
ans = max(ans, (long)(floor(a * i / b) - a * floor(i / b)));
printf("%ld\n", ans);
}
| #include <bits/stdc++.h>
using namespace std;
const long INF = 1L << 60;
int main() {
long a, b, n;
scanf("%ld%ld%ld", &a, &b, &n);
if (b - 1 >= n)
printf("%ld\n", (long)(floor(a * n / b) - a * floor(n / b)));
else
printf("%ld\n", (long)(floor(a * (b - 1) / b) - a * floor((b - 1) / b)));
}
| replace | 8 | 12 | 8 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long A;
long long B, N;
cin >> A >> B >> N;
long long max = 0;
for (long long x = 0; x <= B && x <= N; x++) {
long long p = (A * x) / B - A * (x / B);
if (p > max) {
max = p;
}
}
cout << max << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long A;
long long B, N;
cin >> A >> B >> N;
long long max = 0;
if (N < B) {
max = (A * N) / B - A * (N / B);
} else {
max = (A * (B - 1)) / B - A * ((B - 1) / B);
}
cout << max << endl;
}
| replace | 12 | 17 | 12 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | /**
* Created by hiramekun at 20:54 on 2020-05-02.
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_q... | /**
* Created by hiramekun at 20:54 on 2020-05-02.
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_q... | replace | 54 | 59 | 54 | 58 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// D - Floor Function
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long result = -1;
for (int x = 0; x <= N; x++) {
long long tmp = floor(A * x / B) - A * floor(x / B);
if (result > 0 && tmp == 0)
break;
result = max(result, tmp);
}... | #include <bits/stdc++.h>
using namespace std;
// D - Floor Function
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long x = B - 1;
x = min(x, N);
long long result = floor(A * x / B) - A * floor(x / B);
cout << result;
}
| replace | 8 | 15 | 8 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (ll i = a; (i) < (b); ++(i))
#define RFOR(i, a, b) for (ll i = a; (i) >= (b); --(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define UNIQ(v) ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (ll i = a; (i) < (b); ++(i))
#define RFOR(i, a, b) for (ll i = a; (i) >= (b); --(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define UNIQ(v) ... | replace | 37 | 43 | 37 | 40 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n < b) {
cout << (a * n) / b << endl;
} else {
ll ans = 0;
ll x = b - 1;
while (x < n) {
ll temp = (a * x) / b - a * (x / b);
if (temp > ans)
ans = temp;
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x = (n / b) * b - 1;
if (x == -1)
cout << (a * n) / b;
else
cout << (a * x) / b - a * (x / b);
} | replace | 8 | 21 | 8 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans;
ans = 0;
for (int i = 0; i <= n; i++) {
lo... | #include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans;
ans = 0;
if (n >= b) {
ans = (b - 1) * a /... | replace | 16 | 20 | 16 | 20 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i < b; ++i)
#define rep(i, n) fo(i, 0, n)
#define pln(n) printf("%lld", n)
#define sll(n) scanf("%lld", &n)
#define ss(n) scanf("%s", n)
#define vi vector<int>
#define ll long long
#define pii pair<ll, ll>
#define pb push_back
#define mp make_pair
#define ull... | #include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i < b; ++i)
#define rep(i, n) fo(i, 0, n)
#define pln(n) printf("%lld", n)
#define sll(n) scanf("%lld", &n)
#define ss(n) scanf("%s", n)
#define vi vector<int>
#define ll long long
#define pii pair<ll, ll>
#define pb push_back
#define mp make_pair
#define ull... | replace | 38 | 46 | 38 | 40 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <vector>
using namespace std;
void C(void) {
long long n, m, q;
long long i, j, k;
long long temp_a, temp_b, temp_c, temp_d;
vector<long long> a, b, c, d;
cin >> n >> m >> q;
for (i = 0; i < q; i++) {
c... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <vector>
using namespace std;
void C(void) {
long long n, m, q;
long long i, j, k;
long long temp_a, temp_b, temp_c, temp_d;
vector<long long> a, b, c, d;
cin >> n >> m >> q;
for (i = 0; i < q; i++) {
c... | replace | 34 | 39 | 34 | 38 | TLE | |
p02696 | Python | Time Limit Exceeded | #!/usr/bin/env python3
def main():
import sys
input = sys.stdin.readline
A, B, N = map(int, input().split())
ans = 0
for x in range(N + 1):
res = int((A * x) // B) - A * int(x // B)
ans = max(ans, res)
print(ans)
if __name__ == "__main__":
main()
| #!/usr/bin/env python3
def main():
import sys
input = sys.stdin.readline
A, B, N = map(int, input().split())
x = min(B - 1, N)
print((A * x) // B - A * (x // B))
if __name__ == "__main__":
main()
| replace | 8 | 13 | 8 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, x... | replace | 17 | 40 | 17 | 21 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
using namespace std;
long A, B, N;
long f(double x) { return floor((A * x) / B) - A * floor(x / B); }
int main() {
cin >> A >> B >> N;
long cnt = N > B ? B : N;
long max = -100;
for (long x = 1; x <= cnt; x++) {
long now = f((double)x);
max = max > now ? max : now... | #include <cmath>
#include <iostream>
using namespace std;
long A, B, N;
long f(double x) { return floor((A * x) / B) - A * floor(x / B); }
int main() {
cin >> A >> B >> N;
long min = N > B - 1 ? B - 1 : N;
cout << f(min) << endl;
return 0;
} | replace | 10 | 17 | 10 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <climits>
#include <cmath>
#include <iostream>
typedef long long ll;
using namespace std;
int main() {
ll a;
cin >> a;
ll b;
cin >> b;
ll n;
cin >> n;
ll k = min(b, n);
ll answer = INT_MIN;
for (ll i = k; a * i >= b; i--) {
ll medi = floor((a * i) / b) - a * (floor(i / b));
answer = m... | #include <climits>
#include <cmath>
#include <iostream>
typedef long long ll;
using namespace std;
int main() {
ll a;
cin >> a;
ll b;
cin >> b;
ll n;
cin >> n;
ll k = min(b - 1, n);
ll medi = floor((a * k) / b) - a * (floor(k / b));
cout << medi;
}
| replace | 12 | 19 | 12 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) reps(i, 0, n)
#define Rreps(i, n, e) for (int i = n - 1; i >= e; --i)
#define Rrep(i, n) Rreps(i, n, 0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long l... | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) reps(i, 0, n)
#define Rreps(i, n, e) for (int i = n - 1; i >= e; --i)
#define Rrep(i, n) Rreps(i, n, 0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long l... | replace | 43 | 44 | 43 | 45 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long A, B, M, x, maxim = -1;
int main() {
cin >> A >> B >> M;
if (M < B) {
x = M;
cout << A * x / B << '\n';
} else {
x = B - 1;
while (x < M) {
maxim = max(A * x / B - A * (x / B), maxim);
x += B;
}
x = M;
maxim = max(A * ... | #include <bits/stdc++.h>
using namespace std;
long long A, B, M, x, maxim = -1;
int main() {
cin >> A >> B >> M;
if (M < B) {
x = M;
cout << A * x / B << '\n';
} else {
x = B - 1;
maxim = max(A * x / B - A * (x / B), maxim);
long long coe = ((M + 1) / B) - 1;
x = coe * B - 1;
maxim = m... | replace | 10 | 14 | 10 | 14 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MOD = 1000000007;
const ll INF = 1LL << 60;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, n;
cin >> a >> b >> n;
ll m = -1;
for (int i = 1; i <= n; i++) {
if (i > b) {
... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MOD = 1000000007;
const ll INF = 1LL << 60;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, n;
cin >> a >> b >> n;
ll flag = min(b - 1, n);
ll i = flag;
ll num = (a * i) / ... | replace | 12 | 22 | 12 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long int
using namespace std;
signed main() {
int a, b, n;
cin >> a >> b >> n;
int maxi = INT_MIN;
for (int x = 1; x <= n; x++) {
int t = floor((a * x) / b) - a * floor(x / b);
maxi = max(t, maxi);
}
cout << maxi;
}
| #include <bits/stdc++.h>
#define int long long int
using namespace std;
signed main() {
int a, b, n;
cin >> a >> b >> n;
int x = min(b - 1, n);
cout << floor((a * x) / b) - a * floor(x / b);
return 0;
}
| replace | 6 | 13 | 6 | 9 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
int main() {
ll n, a, b;
cin >> a >> b >> n;
ll ans = 0;
for (ll i = 0; i <= n; i++) {
ans = max(ans, ((a * i) / b) - a * (i / b));
}
cout << ans;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
int main() {
ll n, a, b;
cin >> a >> b >> n;
cout << (a * min(n, (b - 1))) / b;
return 0;
}
| replace | 9 | 14 | 9 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
int64_t A, B, N;
cin >> A >> B >> N;
int64_t max_xB = 0; // A(x%B)のmax
for (int i = 0; i < N; i++) {
int x = i + 1;
max_xB = max(max_xB, x % B);
}
printf("%ld\n", (-A * max_xB % B + A * max_xB) / B);
return 0;
} | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
int64_t A, B, N;
cin >> A >> B >> N;
int64_t x = 0;
if (N < B - 1)
x = N;
else
x = B - 1;
printf("%ld\n", (-A * (x % B) % B + A * (x % B)) / B);
return 0;
} | replace | 8 | 15 | 8 | 14 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define f(i, a, b) for (int i = a; i <= b; i++)
inline ll read() ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define f(i, a, b) for (int i = a; i <= b; i++)
inline ll read() ... | replace | 46 | 52 | 46 | 50 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define M... | #include <bits/stdc++.h> //Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define M... | insert | 55 | 55 | 55 | 56 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
long long MOD = 1000000007LL;
const double PI = 3.14159265358979323846;
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -21474... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
long long MOD = 1000000007LL;
const double PI = 3.14159265358979323846;
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -21474... | replace | 25 | 29 | 25 | 27 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
using namespace std;
using ll = long long;
int main() {
ll a;
ll b, n;
cin >> a >> b >> n;
ll ans = 0;
rep(i, n + 1) {
ll tmp;
tmp = floor((doub... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
using namespace std;
using ll = long long;
int main() {
ll a;
ll b, n;
cin >> a >> b >> n;
ll ans = floor((double)(a * min(b - 1, n)) / b) -
a ... | replace | 11 | 17 | 11 | 13 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
int ans = 0;
for (double x = 1; x <= n; x++) {
int g = ans;
ans = floor(a * x / b) - a * floor(x / b);
ans = max(ans, g);
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0, x = n;
if (n >= b - 1)
x = b - 1;
ans = floor(a * x / b) - a * floor(x / b);
cout << ans << endl;
}
| replace | 7 | 13 | 7 | 12 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define se second
#define fi first
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971
#define MAX 9223372036854775807
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// cout... | #include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define se second
#define fi first
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971
#define MAX 9223372036854775807
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// cout... | replace | 16 | 28 | 16 | 20 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#de... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#de... | replace | 106 | 111 | 106 | 107 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B, N;
cin >> A >> B >> N;
// xはBの倍数-1だけ試す
long long x = B - 1;
int i = 1;
int ans = 0;
if (B > N) {
ans = (A * N) / B - A * (x / B);
cout << ans << endl;
return 0;
}
while (x <= N) {
int TRY;
TRY = (A *... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B, N;
cin >> A >> B >> N;
if (B == 1) { // B = 1の時は計算しない
cout << 0 << endl;
return 0;
}
// xはBの倍数-1だけ試す
long long x = B - 1;
int i = 1;
int ans = 0;
if (B > N) {
ans = (A * N) / B - A * (x / B);
cout << ans <<... | insert | 6 | 6 | 6 | 11 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const int mod = 1e9 + 7;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long x = 0;
long long ans = 0;
if (b > n) {
x = n;
ans = a * x / b;
} else {
double M = 0;
for (int i = 1; i < b; i++) {
d... | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const int mod = 1e9 + 7;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long x = 0;
long long ans = 0;
if (b > n) {
x = n;
ans = a * x / b;
} else {
ans = (int)((double)a * (double)(b - 1) / (double)b);
... | replace | 16 | 25 | 16 | 18 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
#define vll vector<ll>
#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define RE... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
#define vll vector<ll>
#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define RE... | replace | 32 | 40 | 32 | 36 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
typedef long long ll;
const int MOD = 1e9 + 7;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll maxi = INT_MIN;
int j = 1;
if (j > 100000000)
j = 100000000;
for (ll i = j; i <= n; i++) {
maxi = max(maxi, ((a * i) / b) - a * (i / ... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
typedef long long ll;
const int MOD = 1e9 + 7;
int main() {
ll a, b, n;
cin >> a >> b >> n;
// ll maxi=INT_MIN;
ll ans;
if (b <= n)
ans = (a * (b - 1)) / b;
else
ans = (a * n) / b;
cout << ans << endl;
return 0;
}
| replace | 9 | 17 | 9 | 16 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
ty... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
ty... | replace | 273 | 285 | 273 | 274 | TLE | |
p02696 | C++ | Time Limit Exceeded | /**
* Author : Parth Prajapati aka (PARTH_4399, hungry_chef)
* Institute : Pandit Deendayal Petroleum University
**/
#include <bits/stdc++.h>
using namespace std;
#define start_cooking int main()
#define food_is_ready return 0;
#define main_ingredient_added \
io... | /**
* Author : Parth Prajapati aka (PARTH_4399, hungry_chef)
* Institute : Pandit Deendayal Petroleum University
**/
#include <bits/stdc++.h>
using namespace std;
#define start_cooking int main()
#define food_is_ready return 0;
#define main_ingredient_added \
io... | replace | 21 | 27 | 21 | 24 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <iostream>
int main() {
int64_t A, B, N;
std::cin >> A >> B >> N;
int64_t starter = N / B;
starter *= B;
if (starter == 0)
starter = B;
int64_t max_num = 0;
for (int64_t x = B; x <= N; x += B) {
int64_t calcx = x - 1;
int64_t first = A * calcx / B;
int64_t second = calcx / B;
... | #include <iostream>
int main() {
int64_t A, B, N;
std::cin >> A >> B >> N;
int64_t starter = N / B;
starter *= B;
if (starter == 0)
starter = B;
int64_t max_num = 0;
for (int64_t x = starter; x <= N; x += B) {
int64_t calcx = x - 1;
int64_t first = A * calcx / B;
int64_t second = calcx /... | replace | 11 | 12 | 11 | 12 | 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++)
const int INF = 1001001001;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
int ans = 0;
if (b < n)
n = b;
for (int x = 1; x <= n; x++) {
long double x1 = a * x / b;
long double x2 = x / b;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF = 1001001001;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
long long int x = min(n, b - 1);
long long int ans = (a * x / b) - a * (x / b);
cout << ans << endl;
} | replace | 8 | 19 | 8 | 10 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long long
#define pi 3.14159265359
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll m = 0;
for (int i = 1; i <= min(B, N); i++) {
m = max(m, (A * i) / B - A * (i / B));
}
cout << m << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long long
#define pi 3.14159265359
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll m;
if (N < B) {
m = (A * N) / B - A * (N / B);
} else {
m = (A * (B - 1)) / B - A * ((B - 1) / B);
}
cout << m << endl;
} | replace | 10 | 13 | 10 | 15 | TLE | |
p02696 | C++ | Time Limit Exceeded | // containing t test cases
#include <bits/stdc++.h>
#define pb push_back
#define mod 1000000007
#define mkp make_pair
#define fi first
#define se second
#define ll long long
#define scan(n) \
ll a[n]; ... | // containing t test cases
#include <bits/stdc++.h>
#define pb push_back
#define mod 1000000007
#define mkp make_pair
#define fi first
#define se second
#define ll long long
#define scan(n) \
ll a[n]; ... | replace | 42 | 50 | 42 | 45 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;
// const int INF=1010101010;
using Graph = vector<vector<int>>;
int main() {
... | #include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;
// const int INF=1010101010;
using Graph = vector<vector<int>>;
int main() {
... | replace | 13 | 21 | 13 | 15 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#define int long long
signed main() {
int N, A, B;
std::cin >> A >> B >> N;
/*
int start = 0;
int end = N + 1;
int maxVal = 0;
int moy = 0;
while (start < end && moy < N)
{
moy = (start + end) / 2;
... | #include <algorithm>
#include <cmath>
#include <iostream>
#define int long long
signed main() {
int N, A, B;
std::cin >> A >> B >> N;
std::cout << (int)(std::floor((A * std::min((B - 1), N)) / B)) -
(int)((A * std::floor(std::min((B - 1), N) / B)));
} | replace | 8 | 40 | 8 | 10 | 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 P = pair<int, int>;
using ll = long long;
int main() {
long double a, b, n;
cin >> a >> b >> n;
long double ans = 0;
rep(x, n + 1) { ans = max(ans, floor(a * x / b) - a * floor(x / b)); }
cout << ans << endl... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
long double a, b, n;
cin >> a >> b >> n;
long double ans = 0;
if (n < b)
ans = floor(a * n / b) - a * floor(n / b);
else
ans = floor(a * (b - 1) ... | replace | 11 | 12 | 11 | 15 | TLE | |
p02696 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long A, B, N;
cin >> A >> B >> N;
bool flag = false;
long long ans = 0;
long long tmp;
for (int x = 0; x <= N; x++) {
if (A * x < B)
continue;
else if (x < B)
tmp = (A * x) / B;
else
tmp = (A * x) / B - A * (... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long A, B, N;
cin >> A >> B >> N;
long long x = min(B - 1, N);
long long ans = (A * x) / B - A * (x / B);
cout << ans << endl;
return 0;
}
| replace | 7 | 25 | 7 | 10 | 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 all(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG
long long f(long long a, long long b, long long x) {
return a * x / b - a * (x / b);
}
int main() {
using vi = vector<int>;
long long a, b, n;
cin >> a >... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG
long long f(long long a, long long b, long long x) {
return a * x / b - a * (x / b);
}
int main() {
using vi = vector<int>;
long long a, b, n;
cin >> a >... | replace | 18 | 27 | 18 | 25 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.