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
p02597
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define eps 1e-6 #define ll long long #define IOS \ cin.sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0);...
#include <bits/stdc++.h> #define eps 1e-6 #define ll long long #define IOS \ cin.sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0);...
insert
90
90
90
94
TLE
p02597
C++
Runtime Error
#include <algorithm> #include <iostream> #include <iterator> #include <map> #include <set> #include <string> #include <vector> using namespace std; int main() { string str; int N, i, j, count = 0; cin >> N >> str; i = 0; j = N - 1; while (i < j) { if (str[i] == 'W' && str[j] == 'R') { count += 1;...
#include <algorithm> #include <iostream> #include <iterator> #include <map> #include <set> #include <string> #include <vector> using namespace std; int main() { string str; int N, i, j, count = 0; cin >> N >> str; i = 0; j = N - 1; while (i < j) { if (str[i] == 'W' && str[j] == 'R') { count += 1;...
replace
25
26
25
26
0
p02597
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; int N; string str; int S[200001]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ...
#include <algorithm> #include <iostream> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; int N; string str; int S[200001]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ...
delete
25
40
25
25
0
p02597
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, cnt = 0, res = 0; string s; cin >> n >> s; int k = n - 1; for (int i = 0; i < n; i++) { if (s[i] == 'W') cnt++; } while (s[k] != 'R' && k > 0) k--; for (int i = n - cnt - k; i < n; i++) { if (s[i] == 'R') res++; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, cnt = 0, res = 0; string s; cin >> n >> s; int k = n - 1; for (int i = 0; i < n; i++) { if (s[i] == 'W') cnt++; } while (s[k] != 'R' && k > 0) k--; for (int i = n - cnt; i < n; i++) { if (s[i] == 'R') res++; } ...
replace
14
15
14
15
0
p02597
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); ...
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); ...
replace
22
23
22
23
TLE
p02597
C++
Time Limit Exceeded
// const int N=1e5; #define INF 1e9 #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double int n; string s; void sol() { cin >> n; cin >> s; int red = 0, w = 0, swp = 0; for (int i = 0; i < n; ++i) { if (s[i] == 'W') ++w; else ++red; } int cnt = min(re...
// const int N=1e5; #define INF 1e9 #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double int n; string s; void sol() { cin >> n; cin >> s; int red = 0, w = 0, swp = 0; for (int i = 0; i < n; ++i) { if (s[i] == 'W') ++w; else ++red; } int cnt = min(re...
replace
20
30
20
23
TLE
p02597
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #includ...
insert
50
50
50
51
0
p02597
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; int main(void) { int N; cin >> N; char c[N + 1]; c[0] = 'R'; for (int i = 1; i <= N; i++) { cin >> c[i]; } int counter = 0; int numBeforeAllRed = 0; for (int i = N; i != 1; i--) { if (c[i] == 'R') { if (numBeforeAllRed > 0) {...
#include <iostream> #include <string> using namespace std; int main(void) { int N; cin >> N; char c[N + 1]; c[0] = 'R'; for (int i = 1; i <= N; i++) { cin >> c[i]; } int counter = 0; int numBeforeAllRed = 0; for (int i = 1; i <= N; i++) { if (c[i] == 'W') { counter++; } else { ...
insert
17
17
17
28
TLE
p02597
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int #define ld long double #define f first #define s second #define pb push_back #define eb emplace_back #define mk make_pair #define mt make_tuple #define MOD 1000000007 #define fo(i, a, b) for (i = a; i < b; i++) #define foe(i, a, b) for (i = a; i <= b; i++) #define all(x...
#include <bits/stdc++.h> #define ll long long int #define ld long double #define f first #define s second #define pb push_back #define eb emplace_back #define mk make_pair #define mt make_tuple #define MOD 1000000007 #define fo(i, a, b) for (i = a; i < b; i++) #define foe(i, a, b) for (i = a; i <= b; i++) #define all(x...
replace
46
47
46
47
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; bool possible(long long int mid, long long int arr[], long long int n, long long int k) { fo...
#include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; bool possible(long long int mid, long long int arr[], long long int n, long long int k) { if...
insert
16
16
16
18
0
p02598
C++
Runtime Error
#pragma GCC target("sse4.2") #include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #define ln "\n" #define forn(i, e) for (ll i = 0; i < e; i++) #define forsn(i, s, e) for (ll i = s; i < e; i++) #define rforn(i, e) for (ll i = e; i >= 0; i--) #define rforsn(i, e, s) for (...
#pragma GCC target("sse4.2") #include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #define ln "\n" #define forn(i, e) for (ll i = 0; i < e; i++) #define forsn(i, s, e) for (ll i = s; i < e; i++) #define rforn(i, e) for (ll i = e; i >= 0; i--) #define rforsn(i, e, s) for (...
replace
277
279
277
279
0
Time taken : 5.2534e-05s
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, k; int arr[200010]; bool valid(int temp) { int count = 0; for (int i = 0; i < n; i++) { count += (arr[i] + temp - 1) / temp - 1; } if (count <= k) return true; else return false; } int main() { cin >> n >> k; for (int i = 0; i < n; i++) ...
#include <bits/stdc++.h> using namespace std; int n, k; int arr[200010]; bool valid(int temp) { int count = 0; for (int i = 0; i < n; i++) { count += (arr[i] + temp - 1) / temp - 1; } if (count <= k) return true; else return false; } int main() { cin >> n >> k; for (int i = 0; i < n; i++) ...
replace
18
19
18
19
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define SZ(a) ((int)(a).size()) int main() { #ifdef LOCAL freopen(".a.in", "r", stdin); #endif ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0); int n, k; cin >> n >> k; vector<int64_t> A(n); for (int i = 0; i < n; ++i) cin >> A[i]; for (int i = 0...
#include <bits/stdc++.h> using namespace std; #define SZ(a) ((int)(a).size()) int main() { #ifdef LOCAL freopen(".a.in", "r", stdin); #endif ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0); int n, k; cin >> n >> k; vector<int64_t> A(n); for (int i = 0; i < n; ++i) cin >> A[i]; for (int i = 0...
replace
25
26
25
26
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define ld long double #define FOR(x, y) for (ll i = x; i <= y; i++) #define pb(x) push_back(x) #define mp make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define vii vector<int> #define vll vector<ll> #define matrix(x) vector<vector<x>> #define vss vector<s...
#include <bits/stdc++.h> #define ll long long #define ld long double #define FOR(x, y) for (ll i = x; i <= y; i++) #define pb(x) push_back(x) #define mp make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define vii vector<int> #define vll vector<ll> #define matrix(x) vector<vector<x>> #define vss vector<s...
insert
91
91
91
93
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define all(t) t.begin(), t.end() #define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b)))) typedef vector<ll> vi; typedef pair<ll, ll> pii; #define fi first #define se ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define all(t) t.begin(), t.end() #define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b)))) typedef vector<ll> vi; typedef pair<ll, ll> pii; #define fi first #define se ...
replace
87
88
87
88
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define sz(v) ((int)(v).size()) #define all(v) ((v).begin()), ((v).end()) #define allr(v) ((v).rbegin()), ((v).rend()) #define pb push_back #define mp make_pair #define clr(v, d) memset(v, d, sizeof(v)) #define PI acos(-1) typedef long long ll; typedef unsigned long long ull; const double eps =...
#include <bits/stdc++.h> #define sz(v) ((int)(v).size()) #define all(v) ((v).begin()), ((v).end()) #define allr(v) ((v).rbegin()), ((v).rend()) #define pb push_back #define mp make_pair #define clr(v, d) memset(v, d, sizeof(v)) #define PI acos(-1) typedef long long ll; typedef unsigned long long ull; const double eps =...
replace
32
34
32
33
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define mod 1000000007 // #define mod1 9982 #define int long long int #define pii pair<int, int> #define vpii vector<pii> #define vi vector<int> #define fi first #define se second #define psb push_back #define ppb pop_back #define fio ...
#include <bits/stdc++.h> using namespace std; // #define mod 1000000007 // #define mod1 9982 #define int long long int #define pii pair<int, int> #define vpii vector<pii> #define vi vector<int> #define fi first #define se second #define psb push_back #define ppb pop_back #define fio ...
replace
37
38
37
38
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll l...
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll l...
insert
95
95
95
97
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define sf(x) scanf("%d", &x) #define sfl(x) scanf("%lld", &x) #define pf(x) printf("%d\n", x) #define pfl(x) printf("%lld\n", x) #define endl '\n' #define pii pair<int, int> #define mapii map<int, int> #define mapll map<ll, ll> #...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define sf(x) scanf("%d", &x) #define sfl(x) scanf("%lld", &x) #define pf(x) printf("%d\n", x) #define pfl(x) printf("%lld\n", x) #define endl '\n' #define pii pair<int, int> #define mapii map<int, int> #define mapll map<ll, ll> #...
replace
44
45
44
45
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; constexpr int Inf = 1000000010; constexpr ll INF = 2000000000000000000; constexpr ll MOD = 1000000007; const double PI = 3.1415926535897; typedef pair<int, int> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; constexpr int Inf = 1000000010; constexpr ll INF = 2000000000000000000; constexpr ll MOD = 1000000007; const double PI = 3.1415926535897; typedef pair<int, int> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return ...
replace
63
64
63
64
0
p02598
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <vector> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; const int inf = 0x3f3f3f3f; const int mod = 1e9 + 7; int n, a[maxn], k; bool judge(int ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string.h> #include <vector> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; const int inf = 0x3f3f3f3f; const int mod = 1e9 + 7; int n, a[maxn], k; bool judge(int ...
replace
26
27
26
27
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define ios \ ; \ ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define ios \ ; \ ios::sync_with_stdio(false); ...
replace
52
53
52
53
0
p02598
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; bool f(double mid, vector<int> a, int k) { ll t{}; for (int i = 0; i < a.size(); i++) { t += ceil(a.at(i) / mid) - 1; } return t <= k; } int main() { int n, k; cin >> n >> k; vector<int> a(n); for (auto ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; bool f(double mid, vector<int> a, int k) { ll t{}; for (int i = 0; i < a.size(); i++) { t += ceil(a.at(i) / mid) - 1; } return t <= k; } int main() { int n, k; cin >> n >> k; vector<int> a(n); for (auto ...
replace
21
22
21
22
TLE
p02598
C++
Runtime Error
#pragma GCC optimize "trapv" #include <bits/stdc++.h> #include <iostream> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#pragma GCC optimize "trapv" #include <bits/stdc++.h> #include <iostream> using namespace std; #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
replace
40
41
40
41
0
p02598
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; typedef long double ld; const int INF = 1e9; int main() { ll n, k, t = 0; cin >> n >> k; vector<ll> a(n); rep(i, n) cin >> a[i]; ll l = -1, r = 1e9, m; while (r - l > 1) { m = (l + r) /...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef long double ld; const int INF = 1e9; int main() { ll n, k, t = 0; cin >> n >> k; vector<ll> a(n); rep(i, n) cin >> a[i]; ll l = 0, r = 1e9, m; while (r - l > 1) { m = (l + r) / ...
replace
14
15
14
15
0
p02598
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) vector<int> v; int k; bool can(int len) { int cnt = k; for (int i = v.size() - 1; i >= 0; i--) { if (v[...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) vector<int> v; int k; bool can(int len) { if (len == 0) return false; int cnt = k; for (int i = v.siz...
insert
14
14
14
16
0
p02598
C++
Runtime Error
/** * author : Saurav Paul * created : August 03, 2020 11:41 AM * Problem Name : E - Logs * Problem Limit : 2000 ms , 1024 MB * Problem Url : https://atcoder.jp/contests/abc174/tasks/abc174_e * @genarated by : ai-virtual-assistant **/ #include <bits/stdc++.h> using namespace s...
/** * author : Saurav Paul * created : August 03, 2020 11:41 AM * Problem Name : E - Logs * Problem Limit : 2000 ms , 1024 MB * Problem Url : https://atcoder.jp/contests/abc174/tasks/abc174_e * @genarated by : ai-virtual-assistant **/ #include <bits/stdc++.h> using namespace s...
replace
69
70
69
70
0
p02598
C++
Runtime Error
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. ***********************************************...
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. ***********************************************...
replace
25
26
25
26
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define all(v) (v).begin()(v).end() ll n, k; bool check(ll x, std::vector<ll> &v) { ll moves = 0; for (auto i : v) { moves += i / x - (i % x == 0); } return moves <= k; } void solve() { cin >> n >> k; std::vector<ll...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define all(v) (v).begin()(v).end() ll n, k; bool check(ll x, std::vector<ll> &v) { ll moves = 0; for (auto i : v) { moves += i / x - (i % x == 0); } return moves <= k; } void solve() { cin >> n >> k; std::vector<ll...
replace
17
18
17
18
0
p02598
C++
Runtime Error
// include //------------------------------------------ #include <bits/stdc++.h> using namespace std; // typedef //------------------------------------------ using LL = int64_t; using VL = vector<LL>; using VVL = vector<VL>; using VS = vector<string>; using PLL = pair<LL, LL>; // container util //--------------------...
// include //------------------------------------------ #include <bits/stdc++.h> using namespace std; // typedef //------------------------------------------ using LL = int64_t; using VL = vector<LL>; using VVL = vector<VL>; using VS = vector<string>; using PLL = pair<LL, LL>; // container util //--------------------...
replace
154
155
154
155
0
p02598
C++
Time Limit Exceeded
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define req(i, n) for (int i = 1; i <= n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) #define ALL(a) a.begin(), a.end(...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define req(i, n) for (int i = 1; i <= n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) #define ALL(a) a.begin(), a.end(...
replace
26
32
26
30
TLE
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int long long #define endl "\...
#include <bits/stdc++.h> #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int long long #define endl "\...
replace
27
28
27
28
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #pragma region void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print...
#include <bits/stdc++.h> using namespace std; #pragma region void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print...
replace
77
78
77
78
0
p02598
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() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, n) cin >> a[i]; int l = 0, r = 1e9; while (r - 1 > 1) { int x = (l + r) / 2; auto f = [&](int ...
#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() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, n) cin >> a[i]; int l = 0, r = 1e9; while (r - l > 1) { int x = (l + r) / 2; auto f = [&](int ...
replace
12
13
12
13
TLE
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const int MOD = 1e9 + 7; ll a[210000]; bool check(ll N, ll K, ll mid) { ll res = 0; for (int i = 0; i < N; i++) { res += (a[i] - 1) / mid; } if (res > K) return true; else return ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const int MOD = 1e9 + 7; ll a[210000]; bool check(ll N, ll K, ll mid) { ll res = 0; for (int i = 0; i < N; i++) { res += (a[i] - 1) / mid; } if (res > K) return true; else return ...
insert
38
38
38
40
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define fi first #define se second #define m_p make_pair #define p_b push_back #define e_b emplace_back #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) using namespace std; using ll = long long; using ld = long double; template <class T> bool chmax(T &a, T b) { if (a < b...
#include <bits/stdc++.h> #define fi first #define se second #define m_p make_pair #define p_b push_back #define e_b emplace_back #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) using namespace std; using ll = long long; using ld = long double; template <class T> bool chmax(T &a, T b) { if (a < b...
replace
49
50
49
50
0
p02598
C++
Runtime Error
// mai iss duniyaa ka sbse bada chutiyaaa huu #include <bits/stdc++.h> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define mod 1000000007 #define mod2 998244353 #define int long long #define endl '\n' #define p_b push_back #define m_p make_pair #define fastIO ios_bas...
// mai iss duniyaa ka sbse bada chutiyaaa huu #include <bits/stdc++.h> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define mod 1000000007 #define mod2 998244353 #define int long long #define endl '\n' #define p_b push_back #define m_p make_pair #define fastIO ios_bas...
replace
73
74
73
74
0
p02598
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(a) (a).begin(), (a).end() #define LL long long int n; LL k; LL a[200000]; bool ok(LL st) { LL cnt = 0; REP(i, n) { LL cut = (a[i] - 1) / st; cnt += cut; // cer...
#include "bits/stdc++.h" using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(a) (a).begin(), (a).end() #define LL long long int n; LL k; LL a[200000]; bool ok(LL st) { LL cnt = 0; REP(i, n) { LL cut = (a[i] - 1) / st; cnt += cut; // cer...
replace
29
30
29
30
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int n, k; vector<int> a; bool ok(int md) { int cnt = 0; for (int i = 0; i < n; i++) { cnt += (a[i] - 1) / md; } return cnt <= k; } int main() { cin >> n >> k; a.resize(n); for (int i = 0; i < n; i++) { cin >> a[i]; } ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int n, k; vector<int> a; bool ok(int md) { int cnt = 0; for (int i = 0; i < n; i++) { cnt += (a[i] - 1) / md; } return cnt <= k; } int main() { cin >> n >> k; a.resize(n); for (int i = 0; i < n; i++) { cin >> a[i]; } ...
replace
23
24
23
24
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<vector<int>> Graph; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; #define pi 3.14159265359 #define inf 2147483647 #define INF 9223372036854775807 #define mod 1000000007 #define mod2 998244353 ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<vector<int>> Graph; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; #define pi 3.14159265359 #define inf 2147483647 #define INF 9223372036854775807 #define mod 1000000007 #define mod2 998244353 ...
replace
21
22
21
22
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef pair<int, int> P; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef pair<int, int> P; typedef long long ll; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { ...
replace
241
242
241
242
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #include <queue> using namespace std; #define what_is(x) cerr << #x << " is " << x << endl; #define PI acos(-1) #define hell 1000000007 #define HELL 998244353 #define io \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #include <queue> using namespace std; #define what_is(x) cerr << #x << " is " << x << endl; #define PI acos(-1) #define hell 1000000007 #define HELL 998244353 #define io \ ios_base::sync_with_stdio(false); ...
replace
70
71
70
71
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02598
C++
Time Limit Exceeded
// ABHISHEK AGRAWAL,BIT mesra// // Newbie......You have to be odd to be no. ONE :)// #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fl float #define lcm(a, b) (a * (b / __gcd(a, b))) #define vs vector<string> #define vc vector<char> #define vll vector<ll> #define s...
// ABHISHEK AGRAWAL,BIT mesra// // Newbie......You have to be odd to be no. ONE :)// #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fl float #define lcm(a, b) (a * (b / __gcd(a, b))) #define vs vector<string> #define vc vector<char> #define vll vector<ll> #define s...
replace
192
193
192
193
TLE
p02598
C++
Runtime Error
#pragma GCC optimize("Ofast") #include "bits/stdc++.h" #define int long long #define double long double #define PI 3.141592653589793 #define FAST \ ios::sync_with_stdio(false); \ cin.tie(NULL); ...
#pragma GCC optimize("Ofast") #include "bits/stdc++.h" #define int long long #define double long double #define PI 3.141592653589793 #define FAST \ ios::sync_with_stdio(false); \ cin.tie(NULL); ...
replace
40
41
40
41
0
p02598
C++
Runtime Error
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef pair<int, int> pi; #define debug(x) cerr << #x << ": " << x << endl #define debug2(x, y) debug(x), debug(y) #define repn(i, a, b) for (int i =...
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef pair<int, int> pi; #define debug(x) cerr << #x << ": " << x << endl #define debug2(x, y) debug(x), debug(y) #define repn(i, a, b) for (int i =...
replace
40
41
40
41
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int arr[200005]; bool isvalid(int m, int n, int k) { long long total = 0; for (int i = 0; i < n; i++) { total += (arr[i]) / m; if (arr[i] % m == 0) total--; } if (total <= k) return true; return false; } void solve(int n, int k) { int i = 0...
#include <bits/stdc++.h> using namespace std; int arr[200005]; bool isvalid(int m, int n, int k) { if (m == 0) return false; long long total = 0; for (int i = 0; i < n; i++) { total += (arr[i]) / m; if (arr[i] % m == 0) total--; } if (total <= k) return true; return false; } void s...
insert
6
6
6
8
0
p02598
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; using ll = long long; template <typename TYPE> void print_vec(const vector<TYPE> &v) { for (int i = 0; i < v.size(); i++) { cout << v[i] << " "; } cout << endl; } template <typename TYPE> void print_vec2(const vector<vector<TYPE>> &v) { cout << endl; cout <<...
#include "bits/stdc++.h" using namespace std; using ll = long long; template <typename TYPE> void print_vec(const vector<TYPE> &v) { for (int i = 0; i < v.size(); i++) { cout << v[i] << " "; } cout << endl; } template <typename TYPE> void print_vec2(const vector<vector<TYPE>> &v) { cout << endl; cout <<...
replace
46
52
46
56
TLE
p02598
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int>...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int>...
replace
42
43
42
43
0
p02598
C++
Runtime Error
/*Always success does not build on success,success build on failure and * hardwork*/ #include <bits/stdc++.h> #define ll long long #define pb push_back #define vec vector<long long> #define map map<long long, long long> #define scn(t) scanf("%d", &t); #define lscn(t) scanf("%lld", &t); #define mod 1000000007 #define r...
/*Always success does not build on success,success build on failure and * hardwork*/ #include <bits/stdc++.h> #define ll long long #define pb push_back #define vec vector<long long> #define map map<long long, long long> #define scn(t) scanf("%d", &t); #define lscn(t) scanf("%lld", &t); #define mod 1000000007 #define r...
replace
34
35
34
35
0
p02598
C++
Runtime Error
// #pragma GCC optimize("O3") #include <bits/stdc++.h> // #include <ctime> using namespace std; #define FAST_IO \ ios_base::sync_with_stdio(0); \ cin.tie(nullptr) #define FOR(i, a, b) for (int i = (a); i...
// #pragma GCC optimize("O3") #include <bits/stdc++.h> // #include <ctime> using namespace std; #define FAST_IO \ ios_base::sync_with_stdio(0); \ cin.tie(nullptr) #define FOR(i, a, b) for (int i = (a); i...
replace
55
56
55
56
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll inf = 1000000000000000000, mod = 1000000007, BS, k; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll n, k; cin >> n >> k; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll inf = 1000000000000000000, mod = 1000000007, BS, k; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll n, k; cin >> n >> k; ...
replace
17
18
17
18
-11
p02598
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define ROF(i, a, b) for (ll i = a; i >= b; i--) #define per(i, a) ROF(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; using ch = char; typed...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define ROF(i, a, b) for (ll i = a; i >= b; i--) #define per(i, a) ROF(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; using ch = char; typed...
replace
59
60
59
60
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; int ans = -1, l = 0, r = (int)1e9; auto possible = [&](int x) { int cnt = 0; for (int len : arr) { cnt += (len - 1) / x; } return cnt <= k; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; int ans = -1, l = 1, r = (int)1e9 + 7; auto possible = [&](int x) { int cnt = 0; for (int len : arr) { cnt += (len - 1) / x; } return cnt <= ...
replace
10
11
10
11
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iostream> #define vi vector<int> #define lvi vector<long long> #define pi pair<int, int> #define lpi pair<long long, long long> #define mp make_pair #define pb push_back #define ll long long #define N 100005...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iostream> #define vi vector<int> #define lvi vector<long long> #define pi pair<int, int> #define lpi pair<long long, long long> #define mp make_pair #define pb push_back #define ll long long #define N 100005...
replace
99
100
99
100
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define endl "\n" int main() { i64 N, K; cin >> N >> K; vector<i64> A(N); for (i64 i = 0; i < N; i++) cin >> A[i]; i64 ok = 1e9, ng = -1; while (1 < ok - ng) { i64 mid = (ok + ng) / 2; i64 cnt = 0; for (i64 i = 0; i < N; i...
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define endl "\n" int main() { i64 N, K; cin >> N >> K; vector<i64> A(N); for (i64 i = 0; i < N; i++) cin >> A[i]; i64 ok = 1e9, ng = 0; while (1 < ok - ng) { i64 mid = (ok + ng) / 2; i64 cnt = 0; for (i64 i = 0; i < N; i+...
replace
11
12
11
12
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define vll vector<ll> #define pll pair<ll, ll> #define vpll vector<pll> #define ub upper_bound #define lb lower_bound #define all(v) ((v).begin()), ((v).end()) #define allr(v) ((v).rbegin()), ((v).rend()) #de...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define vll vector<ll> #define pll pair<ll, ll> #define vpll vector<pll> #define ub upper_bound #define lb lower_bound #define all(v) ((v).begin()), ((v).end()) #define allr(v) ((v).rbegin()), ((v).rend()) #de...
replace
105
106
105
106
0
p02598
C++
Runtime Error
/* AUTHOR : Ankit Kumar BRANCH : Information Technology INSTITUTE : Birla Institute of Technology */ #include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(0); ...
/* AUTHOR : Ankit Kumar BRANCH : Information Technology INSTITUTE : Birla Institute of Technology */ #include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(0); ...
replace
179
180
179
180
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; scanf("%d%d", &N, &K); vector<int> A(N); for (int i = 0; i < N; ++i) scanf("%d", &A[i]); int lb = 0; int ub = 1 << 30; for (int _ = 0; _ < 32; ++_) { int mb = (lb + ub) / 2; int c = 0; for (int i = 0; i < N; ++i) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N, K; scanf("%d%d", &N, &K); vector<int> A(N); for (int i = 0; i < N; ++i) scanf("%d", &A[i]); int lb = 0; int ub = 1 << 30; while (ub - lb > 1) { int mb = (lb + ub) / 2; int c = 0; for (int i = 0; i < N; ++i) { c += (...
replace
13
14
13
14
0
p02598
C++
Runtime Error
// Believe in yourself #include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef long double ld; #define PB push_back #define MP make_pair #define F first #define S second #define Pair vector<pair<ll, ll>> #define vec vector<ll> #define all(a) a.begin(), a.en...
// Believe in yourself #include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef long double ld; #define PB push_back #define MP make_pair #define F first #define S second #define Pair vector<pair<ll, ll>> #define vec vector<ll> #define all(a) a.begin(), a.en...
replace
54
55
54
55
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF (1 << 29) #define LINF (1LL << 60) #define EPS (1e-10) #define PI 3.1415926535897932384626433832795028 #define all(a) (a).begin(), (a).end() #define sz(x) (int)x.size() #define max_heap priority_queue<int> #define min_heap priority_queue<i...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF (1 << 29) #define LINF (1LL << 60) #define EPS (1e-10) #define PI 3.1415926535897932384626433832795028 #define all(a) (a).begin(), (a).end() #define sz(x) (int)x.size() #define max_heap priority_queue<int> #define min_heap priority_queue<i...
replace
67
68
67
68
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define mp make_pair #define full(a) a.begin(), a.end() #define rfull(a) a.rbegin(), a.rend() using namespace std; const double pi = acos(-1.0); const double pii = 2 * pi; const double eps = 1e-6; const long long MOD = 1e9 + 7; bool tf(lon...
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define mp make_pair #define full(a) a.begin(), a.end() #define rfull(a) a.rbegin(), a.rend() using namespace std; const double pi = acos(-1.0); const double pii = 2 * pi; const double eps = 1e-6; const long long MOD = 1e9 + 7; bool tf(lon...
replace
31
32
31
32
0
p02598
C++
Runtime Error
/* Author: Vishal Singh (singhvishal0304@gmail.com) "The days that break you are the days that make you." */ #include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(false); \...
/* Author: Vishal Singh (singhvishal0304@gmail.com) "The days that break you are the days that make you." */ #include <bits/stdc++.h> using namespace std; #define fastio() \ ios_base::sync_with_stdio(false); \...
replace
66
67
66
67
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (auto &i : A) cin >> i; auto ok = [&](auto x) { long long k = 0; for (auto &a : A) k += (a - 1) / x; return k <= K; }; int l = -1, h = 1e9; while (1 < h - l) { auto m = ...
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (auto &i : A) cin >> i; auto ok = [&](auto x) { long long k = 0; for (auto &a : A) k += (a - 1) / x; return k <= K; }; int l = 0, h = 1e9; while (1 < h - l) { auto m = (...
replace
17
18
17
18
0
p02598
C++
Runtime Error
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; #defi...
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; #defi...
replace
150
152
150
152
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define rep(A, B, C) for (A = B; A < C; ++A) #define pii pair<int, int> #define pll pair<ll, ll> using namespace std; ///////////////////////////////////////////////////// ll N, K; ll A[202020]; ll i, j, k; bool calc(ll aa) { ll k = K, i; rep(i, 0, N) { ll c =...
#include <bits/stdc++.h> #define ll long long #define rep(A, B, C) for (A = B; A < C; ++A) #define pii pair<int, int> #define pll pair<ll, ll> using namespace std; ///////////////////////////////////////////////////// ll N, K; ll A[202020]; ll i, j, k; bool calc(ll aa) { ll k = K, i; rep(i, 0, N) { ll c =...
replace
30
31
30
31
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define F first #define S second #define MP make_pair #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define LCM(a, b) (a) / __gcd((a), (b)) * (b) #define CEIL(a, b) (a) / (b) + (((a) % (b)) ? 1 : 0) #define ln '\n' using namespace std; using LL = ...
#include <bits/stdc++.h> #define F first #define S second #define MP make_pair #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define LCM(a, b) (a) / __gcd((a), (b)) * (b) #define CEIL(a, b) (a) / (b) + (((a) % (b)) ? 1 : 0) #define ln '\n' using namespace std; using LL = ...
replace
77
82
77
78
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <cmath> #include <iomanip> #include <math.h> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } cons...
#include <bits/stdc++.h> using namespace std; #include <cmath> #include <iomanip> #include <math.h> template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } cons...
replace
22
23
22
23
0
p02598
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #define fi first #define se second #define pb ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #define fi first #define se second #define pb ...
insert
57
57
57
59
0
p02598
C++
Runtime Error
#include <algorithm> #include <math.h> #include <stdio.h> using namespace std; typedef long long ll; ll a[200005], n, k; bool possible(double x) { ll i, res = 0; for (i = 1; i <= n; i++) res += (a[i] * 2 / (ll)(x * 2.0) + !(a[i] * 2 % (ll)(x * 2.0) == 0)) - 1; return res <= k; } int main(void) { ll i;...
#include <algorithm> #include <math.h> #include <stdio.h> using namespace std; typedef long long ll; ll a[200005], n, k; bool possible(double x) { ll i, res = 0; for (i = 1; i <= n; i++) res += (a[i] * 2 / (ll)(x * 2.0) + !(a[i] * 2 % (ll)(x * 2.0) == 0)) - 1; return res <= k; } int main(void) { ll i;...
replace
25
26
25
26
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define Int int64_t #define ll long long #define pb push_back using namespace std; const Int MAXN = 200005; const int ALPHA = 26; Int N, K, M; Int X, Y, Z; Int C; vector<Int> ID; vector<Int> SZ; string S; int find(int x) { if (ID[x] == x) return x; return find(ID[x]); } void Union(int ...
#include <bits/stdc++.h> #define Int int64_t #define ll long long #define pb push_back using namespace std; const Int MAXN = 200005; const int ALPHA = 26; Int N, K, M; Int X, Y, Z; Int C; vector<Int> ID; vector<Int> SZ; string S; int find(int x) { if (ID[x] == x) return x; return find(ID[x]); } void Union(int ...
replace
88
89
88
89
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define pi 3.14159265359 #define all(i) i.begin(), i.end() using namespace std; const long long INF = 1e9 + 7; const string alp = "abcdefghijklmnopqrstuvwxyz"; // 26 const string ALP ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define pi 3.14159265359 #define all(i) i.begin(), i.end() using namespace std; const long long INF = 1e9 + 7; const string alp = "abcdefghijklmnopqrstuvwxyz"; // 26 const string ALP ...
replace
25
26
25
26
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double lld; ll MOD = (1e9) + 7; const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1}; const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1}; const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2}; const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double lld; ll MOD = (1e9) + 7; const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1}; const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1}; const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2}; const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};...
insert
70
70
70
74
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPr(i, n) for (int i = (n)-1; i >= 0; --i) #define FORq(i, m, n) for (int i = (m); i <= (n); ++i) #define FORqr(i, m, n) for (int i = (n); i >= (m); --i) #define M...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPr(i, n) for (int i = (n)-1; i >= 0; --i) #define FORq(i, m, n) for (int i = (m); i <= (n); ++i) #define FORqr(i, m, n) for (int i = (n); i >= (m); --i) #define M...
replace
64
66
64
66
0
p02598
C++
Runtime Error
// Hail god Yato #include <bits/stdc++.h> using namespace std; #define hs \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0...
// Hail god Yato #include <bits/stdc++.h> using namespace std; #define hs \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0...
replace
11
13
11
13
0
p02598
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, K, m = 0; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; m = max(A[i], m); } int l = 1, r = m; int ans = m; for (int j = 0; j < 10000; j++) { if (l == r) break; int a = l + (r - l) / 2; ...
#include <bits/stdc++.h> using namespace std; int main() { int N, K, m = 0; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; m = max(A[i], m); } int l = 1, r = m; int ans = m; for (int j = 0; j < 100; j++) { if (l == r) break; int a = l + (r - l) / 2; ...
replace
13
14
13
14
TLE
p02598
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(c) (c).begin(), (c).end() // 区間[a, b)の中で最初に pred(x) = true となるような x を返す。 // そのような x が存在しないときは b を返す。 template <class Pred> int64_t bin_search(int64_t a...
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(c) (c).begin(), (c).end() // 区間[a, b)の中で最初に pred(x) = true となるような x を返す。 // そのような x が存在しないときは b を返す。 template <class Pred> int64_t bin_search(int64_t a...
replace
37
38
37
38
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e15; #include <math.h> #define PI 3.14159265358979323846264338327950L const int mxN = 1e9 + 7; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int l = 0, ...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e15; #include <math.h> #define PI 3.14159265358979323846264338327950L const int mxN = 1e9 + 7; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int l = 1, ...
replace
16
17
16
17
0
p02598
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io() { std:...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io() { std:...
replace
71
72
71
72
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, k, a[200005]; bool pos(int l) { int cnt = 0; for (int i = 0; i < n; ++i) { cnt += (a[i] + l - 1) / l - 1; } if (cnt > k) return false; return true; } int main() { scanf("%d%d", &n, &k); for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); ...
#include <bits/stdc++.h> using namespace std; int n, k, a[200005]; bool pos(int l) { if (l == 0) return false; int cnt = 0; for (int i = 0; i < n; ++i) { cnt += (a[i] + l - 1) / l - 1; } if (cnt > k) return false; return true; } int main() { scanf("%d%d", &n, &k); for (int i = 0; i < n; +...
insert
6
6
6
8
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; ll k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; auto isok = [&](int m) -> bool { int sum = 0; for (auto aa : a) sum...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; ll k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; auto isok = [&](int m) -> bool { int sum = 0; for (auto aa : a) sum...
replace
23
25
23
25
0
p02598
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS 1 #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define LL lon...
#define _CRT_SECURE_NO_WARNINGS 1 #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define LL lon...
replace
52
53
52
53
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<int, int> P; typedef map<int, int> MP; #define INF 1e9 int main(int, char **) { int n, k; cin >> n >> k; vector<int> a(n); int l = 0, r = 0, mid; rep(i, n) { cin >> a[i]; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<int, int> P; typedef map<int, int> MP; #define INF 1e9 int main(int, char **) { int n, k; cin >> n >> k; vector<int> a(n); int l = 1, r = 0, mid; rep(i, n) { cin >> a[i]; ...
replace
16
17
16
17
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; int lo = 0, hi = 1e10; while (lo < hi) { int mid = (lo + hi) / 2, r = 0; ...
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; int lo = 1, hi = 1e10; while (lo < hi) { int mid = (lo + hi) / 2, r = 0; ...
replace
13
14
13
14
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a) for (int i = 0; i < (a); i++) typedef long long ll; #ifdef _DEBUG inline void dump() { cerr << endl; } template <typename Head> void dump(Head &&head) { cerr << head; dump(); } template <typename Head, typename... Tail> void dump(Head &&head, Tail &&....
#include <bits/stdc++.h> using namespace std; #define rep(i, a) for (int i = 0; i < (a); i++) typedef long long ll; #ifdef _DEBUG inline void dump() { cerr << endl; } template <typename Head> void dump(Head &&head) { cerr << head; dump(); } template <typename Head, typename... Tail> void dump(Head &&head, Tail &&....
replace
52
53
52
53
0
p02598
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <math.h> #include <string.h> #include <string> #define ll long long int #define pb push_back #define fi first #define se second #define N 100005 #define inf 1e18 #define mem(a, b) memset(a, b, sizeof(a)) #define debug(x) cout ...
#include <algorithm> #include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <math.h> #include <string.h> #include <string> #define ll long long int #define pb push_back #define fi first #define se second #define N 100005 #define inf 1e18 #define mem(a, b) memset(a, b, sizeof(a)) #define debug(x) cout ...
replace
107
108
107
108
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define ALL(c) begin(c), end(c) using namespace std; using ll = long long; using ld = long double; const int N = 1e6 + 6; int main() { // freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); ios::sync_with_stdio(0); cin.tie(0); // cout.precision(12);cout<<fixed; int n,...
#include <bits/stdc++.h> #define ALL(c) begin(c), end(c) using namespace std; using ll = long long; using ld = long double; const int N = 1e6 + 6; int main() { // freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); ios::sync_with_stdio(0); cin.tie(0); // cout.precision(12);cout<<fixed; int n,...
replace
20
21
20
21
0
p02598
C++
Runtime Error
#include <algorithm> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long LL; typedef unsigned long...
#include <algorithm> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long LL; typedef unsigned long...
insert
1,507
1,507
1,507
1,511
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(), (x).end() #define COUT(x) cout << (x) << "\n" #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(), (x).end() #define COUT(x) cout << (x) << "\n" #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
replace
50
51
50
51
0
p02598
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, k; scanf("%d %d", &n, &k); vector<int> a(n); int left = 0, right = 0; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); right = max(right, a[i]); } while (left < right) { int mid = (left + rig...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, k; scanf("%d %d", &n, &k); vector<int> a(n); int left = 1, right = 0; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); right = max(right, a[i]); } while (left < right) { int mid = (left + rig...
replace
9
10
9
10
0
p02598
C++
Runtime Error
// #include <bits/stdc++.h> // #pragma GCC optimize(2) #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> #define X first #define Y second ...
// #include <bits/stdc++.h> // #pragma GCC optimize(2) #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> #define X first #define Y second ...
replace
121
126
121
122
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long ll n, k; ll a[200001]; bool check(ll x) { ll mov = 0; for (ll i = 0; i < n; i++) { mov += (a[i] - 1) / x; } if (mov <= k) { return true; } return false; } int main() { cin >> n >> k; for (ll i = 0; i < n; i++) { cin >> a[i]; ...
#include <bits/stdc++.h> using namespace std; #define ll long long ll n, k; ll a[200001]; bool check(ll x) { ll mov = 0; for (ll i = 0; i < n; i++) { mov += (a[i] - 1) / x; } if (mov <= k) { return true; } return false; } int main() { cin >> n >> k; for (ll i = 0; i < n; i++) { cin >> a[i]; ...
replace
20
21
20
21
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n, m, a[N]; bool check(int x) { int y = m; for (int i = 1; i <= n; i++) { y -= (a[i] - 1) / x; } return y >= 0; } int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; } sort(a + 1, a + n + 1); int l ...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n, m, a[N]; bool check(int x) { int y = m; for (int i = 1; i <= n; i++) { y -= (a[i] - 1) / x; } return y >= 0; } int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >> a[i]; } sort(a + 1, a + n + 1); int l ...
replace
20
21
20
21
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(int argc, const char *argv[]) { ll n, k; cin >> n >> k; vector<ll> va(n); for (int i = 0; i < n; ++i) { cin >> va[i]; } ll left = 0, right = *max_element(va.begin(), va.end()); auto check = [](vector<ll> &va, ll mid, ll k)...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(int argc, const char *argv[]) { ll n, k; cin >> n >> k; vector<ll> va(n); for (int i = 0; i < n; ++i) { cin >> va[i]; } ll left = 1, right = *max_element(va.begin(), va.end()); auto check = [](vector<ll> &va, ll mid, ll k)...
replace
13
14
13
14
0
p02598
C++
Runtime Error
/* YATIN KWATRA _03_08_14 Let's Hoop.. __oooo // / o / / | o | / |__ o | | __/ o | | / oooo | / | _______________________ | | | |_______________________| || |___ \__/\_/\_/\/\/\/\/\/\/...
/* YATIN KWATRA _03_08_14 Let's Hoop.. __oooo // / o / / | o | / |__ o | | __/ o | | / oooo | / | _______________________ | | | |_______________________| || |___ \__/\_/\_/\/\/\/\/\/\/...
replace
163
164
163
164
-11
p02598
C++
Runtime Error
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define watch(x) cout << (#x) << " is " << (x) << endl #define debug cout << "hi" << endl using namespace std; typedef long long ll; typedef long double ld; typedef ...
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define watch(x) cout << (#x) << " is " << (x) << endl #define debug cout << "hi" << endl using namespace std; typedef long long ll; typedef long double ld; typedef ...
replace
41
42
41
49
0
p02598
C++
Runtime Error
/*input */ #include <bits/stdc++.h> #include <unistd.h> #define rep(i, j, n) for (i = j; i < n; i++) #define repi(i, j, n) for (i = j; i > n; i--) #define inf 1e18 #define M 1000000007 #define pie 3.141592653589793238 #define ll long long #define ld long double #define vll vector<ll> #define pll pair<ll, ll> #define...
/*input */ #include <bits/stdc++.h> #include <unistd.h> #define rep(i, j, n) for (i = j; i < n; i++) #define repi(i, j, n) for (i = j; i > n; i--) #define inf 1e18 #define M 1000000007 #define pie 3.141592653589793238 #define ll long long #define ld long double #define vll vector<ll> #define pll pair<ll, ll> #define...
replace
51
52
51
52
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define rep(i, begin, end) \ for (__typeof(end) i = (begin) - ((begin) > (end)); \ ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define rep(i, begin, end) \ for (__typeof(end) i = (begin) - ((begin) > (end)); \ ...
replace
57
58
57
58
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define double long double #define ff first #define ss second #define endl '\n' #define ii pair<int, int> #define mp make_pair #define mt make_tuple #define DESYNC \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define int long long #define double long double #define ff first #define ss second #define endl '\n' #define ii pair<int, int> #define mp make_pair #define mt make_tuple #define DESYNC \ ios_base::sync_with_stdio(false); ...
replace
63
64
63
64
0
p02598
C++
Runtime Error
// Nihal Mittal - nihal_47 // Strike First , Strike Hard , No Mercy !! /**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀ ⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀ ⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀ ⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀ ⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀ ⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀ ⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀ ⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀...
// Nihal Mittal - nihal_47 // Strike First , Strike Hard , No Mercy !! /**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀ ⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀ ⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀ ⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀ ⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀ ⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀ ⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀ ⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀...
replace
56
57
56
57
0
p02598
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ll N, K; cin >> N >> K; vector<ll> A(N, 0); ll minX = 0; ll maxX = 0; for (int i = 0; i < N; i++) { cin >> A[i]; if (maxX < A[i]) maxX = A[i]; } while (true) { ll X = minX...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ll N, K; cin >> N >> K; vector<ll> A(N, 0); ll minX = 0; ll maxX = 0; for (int i = 0; i < N; i++) { cin >> A[i]; if (maxX < A[i]) maxX = A[i]; } while (true) { ll X = minX...
insert
19
19
19
21
0