Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
⌀
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02549
#include <algorithm> #include <cassert> #include <chrono> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #in...
#include <algorithm> #include <cassert> #include <chrono> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #in...
null
245,900
245,899
u535347736
cpp
p02549
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; int n, k; int l[15], r[15]; int bit[200005]; int sum(int pos) { int res = 0; while (pos > 0) { res = (res + bit[pos]) % mod; pos -= pos & -pos; } return res; } void add(int pos, int val) { while (pos <= n) { bit[pos] = (b...
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; int n, k; int l[15], r[15]; int bit[200005]; int sum(int pos) { int res = 0; while (pos > 0) { res = (res + bit[pos]) % mod; pos -= pos & -pos; } return res; } void add(int pos, int val) { while (pos <= n) { bit[pos] = (b...
null
245,901
245,902
u659725815
cpp
p02549
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; int n, k; int dp[200010]; int l[20], r[20]; int main() { scanf("%d%d", &n, &k); for (int i = 0; i < k; ++i) scanf("%d%d", &l[i], &r[i]); dp[1] = 1; for (int i = 2; i <= n; ++i) { for (int j = 0; j < k; ++j) if (l[j] <= i - ...
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; int n, k; long long dp[200010]; int l[20], r[20]; int main() { scanf("%d%d", &n, &k); for (int i = 0; i < k; ++i) scanf("%d%d", &l[i], &r[i]); dp[1] = 1; for (int i = 2; i <= n; ++i) { for (int j = 0; j < k; ++j) if (l[j] <...
null
245,913
245,914
u906318193
cpp
p02549
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <time....
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <time....
null
245,860
245,861
u810616694
cpp
p02550
#include <bits/stdc++.h> #define ll long long #define pii pair<ll int, ll int> #define PI 2 * acos(0) //#define mx 1000000 #define INF LONG_LONG_MAX using namespace std; const ll int p = 998244353; // vector<ll > prime; // bool mark[mx]; ll int mod(ll int a, ll int b) { ll int m = a % b; if (m < 0) m = (b < 0) ...
#include <bits/stdc++.h> #define ll long long #define pii pair<ll int, ll int> #define PI 2 * acos(0) //#define mx 1000000 #define INF LONG_LONG_MAX using namespace std; const ll int p = 998244353; // vector<ll > prime; // bool mark[mx]; ll int mod(ll int a, ll int b) { ll int m = a % b; if (m < 0) m = (b < 0) ...
null
246,490
246,491
u741541584
cpp
p02550
#include <bits/stdc++.h> #define int long long #define double long double using namespace std; const int MOD = 1000000007; const int INF = 1e11; using Graph = vector<vector<int>>; signed main() { int N, X, M; cin >> N >> X >> M; vector<int> kou; set<int> num; kou.push_back(X); num.insert(X); int ans = 0...
#include <bits/stdc++.h> #define int long long #define double long double using namespace std; const int MOD = 1000000007; const int INF = 1e11; using Graph = vector<vector<int>>; signed main() { int N, X, M; cin >> N >> X >> M; vector<int> kou; set<int> num; kou.push_back(X); num.insert(X); int ans = 0...
null
246,509
246,510
u521652313
cpp
p02550
#include <bits/stdc++.h> using namespace std; int main() { uint64_t n; uint64_t m, x; cin >> n >> x >> m; vector<uint64_t> r(m, -1); vector<uint64_t> sum(2, 0); sum[1] = x; r[x] = 1; int curr = 2; uint64_t next = x * x % m; while (r[next] == -1) { r[next] = curr; sum.push_back(sum[sum.size()...
#include <bits/stdc++.h> using namespace std; int main() { uint64_t n; uint64_t m, x; cin >> n >> x >> m; vector<int64_t> r(m, -1); vector<int64_t> sum(2, 0); sum[1] = x; r[x] = 1; int curr = 2; uint64_t next = x * x % m; while (r[next] == -1) { r[next] = curr; sum.push_back(sum[sum.size() -...
null
246,513
246,514
u004063473
cpp
p02550
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <numeric> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(a) (a).begin(), (a).end() #define REP(i, n) for (size_t i = 0; i < (n); i++) #define nvec(T, v, n) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <numeric> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(a) (a).begin(), (a).end() #define REP(i, n) for (size_t i = 0; i < (n); i++) #define nvec(T, v, n) ...
null
246,544
246,545
u412025794
cpp
p02550
/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/ //#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); typedef long long ll; using pii = pair<int, int>; const double PI = acos(-1.0)...
/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/ //#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); typedef long long ll; using pii = pair<int, int>; const double PI = acos(-1.0)...
null
246,565
246,566
u802237789
cpp
p02550
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; const ll mod = 1000000007; const int INF = 1001001001; ll pow_mod(ll x, ll y) { ll res = 1; for (ll i = 0; i <...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; const ll mod = 1000000007; const int INF = 1001001001; ll pow_mod(ll x, ll y) { ll res = 1; for (ll i = 0; i <...
null
246,557
246,558
u618263300
cpp
p02550
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repc(i, a, b) for (int i = a; i <= (int)(b); i++) #define ll long long #define vec vector #define pb push_back #define ft first #define sd second #define all(vec) vec.begin(), vec.end() typedef pair<int, int> P;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repc(i, a, b) for (int i = a; i <= (int)(b); i++) #define ll long long #define vec vector #define pb push_back #define ft first #define sd second #define all(vec) vec.begin(), vec.end() typedef pair<int, int> P;...
null
246,827
246,828
u707315894
cpp
p02550
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define debug(x) cerr << #x << ": " << (x) << endl using namespace std; using llong = long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; constexpr ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define debug(x) cerr << #x << ": " << (x) << endl using namespace std; using llong = long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; constexpr ...
null
246,829
246,830
u209767598
cpp
p02550
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; using ll = int64_t; #define rep(i, j, n) for (int i = (j); i < (int)(n); ++i) #define rrep(i, j, n) for (int i = (int)(n)...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; using ll = int64_t; #define rep(i, j, n) for (int i = j; i < (int)(n); ++i) #define rrep(i, j, n) for (int i = (int)(n)-1...
null
246,841
246,842
u843175622
cpp
p02550
#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 < n; ++i) main(void) { ll n, x, m; cin >> n >> x >> m; vector<ll> id(m, -1); vector<ll> a; ll len = 0; ll tot = 0; while (id[x] == -1) { a.push_back(x); id[x] = len; ...
#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 < n; ++i) main(void) { ll n, x, m; cin >> n >> x >> m; vector<ll> id(m, -1); vector<ll> a; ll len = 0; ll tot = 0; while (id[x] == -1) { a.push_back(x); id[x] = len; ...
null
246,874
246,875
u046952850
cpp
p02550
#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 < n; ++i) main(void) { ll n, x, m; cin >> n >> x >> m; vector<int> id(m, -1); vector<int> a; int len = 0; ll tot; while (id[x] == -1) { a.push_back(x); id[x] = len; ...
#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 < n; ++i) main(void) { ll n, x, m; cin >> n >> x >> m; vector<int> id(m, -1); vector<int> a; int len = 0; ll tot = 0; while (id[x] == -1) { a.push_back(x); id[x] = len...
null
246,876
246,877
u046952850
cpp
p02550
#include <bits/stdc++.h> using namespace std; long long MOD = 998244353; int main() { long long n, x, m; cin >> n >> x >> m; long long ans = 0; vector<long long> remain; int cnt = 0; vector<int> used(m + 1); used[m] = 1; remain.push_back(x); cnt++; long long cur = (x * x) % m; long long sum = x; ...
#include <bits/stdc++.h> using namespace std; long long MOD = 998244353; int main() { long long n, x, m; cin >> n >> x >> m; long long ans = 0; vector<long long> remain; int cnt = 0; vector<int> used(m + 1); used[m] = 1; remain.push_back(x); cnt++; long long cur = (x * x) % m; long long sum = x; ...
null
246,917
246,918
u537618496
cpp
p02550
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { ll n, x, m; cin >> n >> x >> m; ll id = 1; vector<ll> a(1000010); a[0] = x; map<ll, ll> m...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { ll n, x, m; cin >> n >> x >> m; ll id = 1; vector<ll> a(1000010); a[0] = x; map<ll, ll> m...
null
246,926
246,927
u633967774
cpp
p02550
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { ll N, x, m; cin >> N >> x >> m; vector<int> ord(m, -1); vector<ll> rireki, syu; ll res = 0;...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { ll N, x, m; cin >> N >> x >> m; vector<int> ord(m, -1); vector<ll> rireki, syu; ll res = 0;...
null
246,928
246,929
u633967774
cpp
p02550
#include <bits/stdc++.h> using namespace std; double pi = 3.14159265358979323846264338; inline void ex() { cout << "Yes" << endl; exit(0); } long long a, b, c, d; long long n, k, ind; bool ok[1000001]; long long arr[11][3]; map<long long, long long> ma; long long arr3[200001]; long long N; long long T(long long...
#include <bits/stdc++.h> using namespace std; double pi = 3.14159265358979323846264338; inline void ex() { cout << "Yes" << endl; exit(0); } long long a, b, c, d; long long n, k, ind; bool ok[1000001]; long long arr[11][3]; map<long long, long long> ma; long long arr3[200001]; long long N; long long T(long long...
null
246,940
246,941
u176843436
cpp
p02550
#include <bits/stdc++.h> using namespace std; #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define rep(i, n) repl(i, 0, n) #define CST(x) cout << fixed << setprecision(x) using ll = long long; const ll MOD = 1000000007; const int inf = 1e9 + 10; const ll INF = 4e18 + 10; const int dx[9] = {1, 0, -1, 0, 1, -1, -...
#include <bits/stdc++.h> using namespace std; #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define rep(i, n) repl(i, 0, n) #define CST(x) cout << fixed << setprecision(x) using ll = long long; const ll MOD = 1000000007; const int inf = 1e9 + 10; const ll INF = 4e18 + 10; const int dx[9] = {1, 0, -1, 0, 1, -1, -...
null
246,959
246,960
u936602931
cpp
p02550
#include <bits/stdc++.h> // #include <atcoder/all> // using namespace atcoder; using namespace std; #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define all(x) (x).begin(), (x).end() #def...
#include <bits/stdc++.h> // #include <atcoder/all> // using namespace atcoder; using namespace std; #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define all(x) (x).begin(), (x).end() #def...
null
247,197
247,198
u366381207
cpp
p02550
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define PI 3.1415926535897932384626433832795028 #define INF (1 << 29) #define LINF (1LL << 60) using namespace std; using INT = long long; using P = pair<int, int>; int main() { INT n, x, m; cin >> n >> x >> m; bool check = true; int cnt =...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define PI 3.1415926535897932384626433832795028 #define INF (1 << 29) #define LINF (1LL << 60) using namespace std; using INT = long long; using P = pair<int, int>; int main() { INT n, x, m; cin >> n >> x >> m; bool check = true; int cnt =...
null
247,284
247,285
u818476133
cpp
p02550
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() using namespace std; int main() { long long n, x, m, l[100005] = {}, sum[100005] = {}, ans = 0, c = 1000000, d; cin >> n >> x >> m; for (int i = 0; i < m && i < n; i++) { if (i != 0) sum[i] += x + sum[i - 1]; else sum[i] = x; l[i] ...
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() using namespace std; int main() { long long n, x, m, l[100005] = {}, sum[100005] = {}, ans = 0, c = 1000000, d; cin >> n >> x >> m; for (int i = 0; i < m && i < n; i++) { if (i != 0) sum[i] += x + sum[i - 1]; else sum[i] = x; l[i] ...
null
247,292
247,293
u490965711
cpp
p02550
// Bismillahir Rahmanir Rahim // ALGO: #include <bits/stdc++.h> #define pb push_back #define F first #define S second #define all(v) v.begin(), v.end() #define FILL(a, x) memset(a, x, sizeof(a)) #define ll long long #define Fast \ ...
// Bismillahir Rahmanir Rahim // ALGO: #include <bits/stdc++.h> #define pb push_back #define F first #define S second #define all(v) v.begin(), v.end() #define FILL(a, x) memset(a, x, sizeof(a)) #define ll long long #define Fast \ ...
null
247,299
247,300
u888328718
cpp
p02550
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; vector<ll> to(m); rep(i, m) { to[i] = ((ll)i * i) % m; } deque<ll> a; // 繰り返しの部分 vector<bool> s...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; vector<ll> to(m); rep(i, m) { to[i] = ((ll)i * i) % m; } deque<ll> a; // 繰り返しの部分 vector<bool> s...
null
247,305
247,306
u915797797
cpp
p02550
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; vector<ll> to(m); rep(i, m) { to[i] = ((ll)i * i) % m; } deque<int> a; // 繰り返しの部分 vector<bool> s...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; vector<ll> to(m); rep(i, m) { to[i] = ((ll)i * i) % m; } deque<ll> a; // 繰り返しの部分 vector<bool> s...
null
247,307
247,306
u915797797
cpp
p02550
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include "bits/stdc++.h" #ifdef _MSC_VER #include <intrin.h> //gcc上ではこれがあると動かない。__popcnt, umul128 等用のincludeファイル。 #define __builtin_popcount __popcnt #define __builtin_popcountll __popcnt64 //#pragma intrinsic(_umul128) #endif ...
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include "bits/stdc++.h" #ifdef _MSC_VER #include <intrin.h> //gcc上ではこれがあると動かない。__popcnt, umul128 等用のincludeファイル。 #define __builtin_popcount __popcnt #define __builtin_popcountll __popcnt64 //#pragma intrinsic(_umul128) #endif ...
null
247,308
247,309
u373908456
cpp
p02550
#include <bits/stdc++.h> #define cases \ long long test; \ cin >> test; \ while (test--) #define f_io ...
#include <bits/stdc++.h> #define cases \ long long test; \ cin >> test; \ while (test--) #define f_io ...
null
246,316
246,317
u943205580
cpp
p02550
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
null
246,330
246,331
u196953553
cpp
p02550
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
null
246,332
246,331
u196953553
cpp
p02550
#include <bits/stdc++.h> //#include<atcoder/all> using namespace std; // using namespace atcoder; int main() { long long N, X, M; cin >> N >> X >> M; set<long long> s; long long A = X; s.insert(A); long long sum = A; while (N - 1 > 0) { A = A * A % M; if (s.find(A) != s.end()) { long long ...
#include <bits/stdc++.h> //#include<atcoder/all> using namespace std; // using namespace atcoder; int main() { long long N, X, M; cin >> N >> X >> M; set<long long> s; long long A = X; s.insert(A); long long sum = A; N--; while (N > 0) { A = A * A % M; if (s.find(A) != s.end()) { long lo...
null
246,359
246,360
u853817705
cpp
p02550
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF 1e9 #define LINF 1e18 typedef long long ll; int main() { ll N, X, M; ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF 1e9 #define LINF 1e18 typedef long long ll; int main() { ll N, X, M; ...
null
246,375
246,376
u116774833
cpp
p02550
#include <bits/stdc++.h> #define watch(x) std::cout << (#x) << " is " << (x) << std::endl #define print(x) std::cout << (x) << std::endl using LL = long long; int main() { // freopen("in","r",stdin); std::ios::sync_with_stdio(false); std::cin.tie(nullptr); LL n, r = 0; int x, m; std::cin >> n >> x >> m; ...
#include <bits/stdc++.h> #define watch(x) std::cout << (#x) << " is " << (x) << std::endl #define print(x) std::cout << (x) << std::endl using LL = long long; int main() { // freopen("in","r",stdin); std::ios::sync_with_stdio(false); std::cin.tie(nullptr); LL n, r = 0; int x, m; std::cin >> n >> x >> m; ...
null
246,397
246,398
u160218791
cpp
p02550
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> a; set<int> p; int now = x; ll ans = 0, sum = 0; while (!p.count(now)) { a.push_back(now); p.insert(now); now = now % m * now % m; } int l = 0; for (int i = 0; i <...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> a; set<int> p; int now = x; ll ans = 0, sum = 0; while (!p.count(now)) { a.push_back(now); p.insert(now); now = now % m * now % m; } int l = 0; for (int i = 0; i <...
null
246,399
246,400
u030504180
cpp
p02550
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> a; set<int> p; int now = x; ll ans = 0, sum = 0; while (!p.count(now)) { a.push_back(now); p.insert(now); now = now % m * now % m; } int l = 0; for (int i = 0; i <...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> a; set<int> p; int now = x; ll ans = 0, sum = 0; while (!p.count(now)) { a.push_back(now); p.insert(now); now = now % m * now % m; } int l = 0; for (int i = 0; i <...
null
246,401
246,400
u030504180
cpp
p02550
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> a; set<int> p; int now = x; ll ans = 0, sum = 0; while (!p.count(now)) { a.push_back(now); p.insert(now); now = now % m * now % m; } int l = 0; for (int i = 0; i <...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> a; set<int> p; int now = x; ll ans = 0, sum = 0; while (!p.count(now)) { a.push_back(now); p.insert(now); now = now % m * now % m; } int l = 0; for (int i = 0; i <...
null
246,402
246,400
u030504180
cpp
p02550
/* author : Aryan Agarwal, IIT KGP created : 19-September-2020 18:27:12 IST */ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long ull; #define int ll const int INF = (int)2e18; const int MOD = 1000000007; /*more than (10)^9*/ /*7 + 1e9*/ const int PEG = 9982443...
/* author : Aryan Agarwal, IIT KGP created : 19-September-2020 18:27:12 IST */ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long ull; #define int ll const int INF = (int)2e18; const int MOD = 1000000007; /*more than (10)^9*/ /*7 + 1e9*/ const int PEG = 9982443...
null
246,417
246,418
u213317118
cpp
p02550
// Believe in yourself #include <bits/stdc++.h> #include <ctime> 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...
// Believe in yourself #include <bits/stdc++.h> #include <ctime> 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...
null
246,429
246,430
u642556730
cpp
p02550
// Believe in yourself #include <bits/stdc++.h> #include <ctime> 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...
// Believe in yourself #include <bits/stdc++.h> #include <ctime> 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...
null
246,431
246,430
u642556730
cpp
p02550
#include <bits/stdc++.h> #define ll long long int #define pragi(a, b) for (ll i = a; i < b; i++) #define pragj(a, b) for (ll j = a; j < b; j++) #define pragk(a, b) for (ll k = a; k >= b; k--) #define all(v) (v.begin(), v.end()) #define eb emplace_back #define lb lower_bound #define ub upper_bound #define MP make_pair #...
#include <bits/stdc++.h> #define ll long long int #define pragi(a, b) for (ll i = a; i < b; i++) #define pragj(a, b) for (ll j = a; j < b; j++) #define pragk(a, b) for (ll k = a; k >= b; k--) #define all(v) (v.begin(), v.end()) #define eb emplace_back #define lb lower_bound #define ub upper_bound #define MP make_pair #...
null
246,434
246,435
u636478865
cpp
p02550
// E - Sequence Sum #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { long long n, x, m, c = 0, l = 0; cin >> n >> x >> m; long long ans = 0; map<long long, int> s; for (c = 0; c < n; c++) { if (s.count(x) > 0) { l = c - s[x]; break; } ans += x; s[x...
// E - Sequence Sum #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { long long n, x, m, c = 0, l = 0; cin >> n >> x >> m; long long ans = 0; map<long long, int> s; for (c = 0; c < n; c++) { if (s.count(x) > 0) { l = c - s[x]; break; } ans += x; s[x...
null
246,440
246,441
u839953699
cpp
p02550
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <unordered_map> #include <vector> using namespace std; long long fast_mod(long long a, long long b, long long p) { long long ans = 1 % p; long long tmp = a; for (; b > 0; b /= 2) { if (b ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <unordered_map> #include <vector> using namespace std; long long fast_mod(long long a, long long b, long long p) { long long ans = 1 % p; long long tmp = a; for (; b > 0; b /= 2) { if (b ...
null
246,442
246,443
u159923090
cpp
p02550
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define rep(i, a) for (int i = 0; i < (int)(a); i++) #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll typedef long long ll; template <typename T> istream &operator>>(istream &i, vector<T> &v) { rep(j, sz...
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define rep(i, a) for (int i = 0; i < (int)(a); i++) #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll typedef long long ll; template <typename T> istream &operator>>(istream &i, vector<T> &v) { rep(j, sz...
null
246,608
246,609
u305824645
cpp
p02550
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> constexpr long long INF = 1LL << 60; constexpr long long MOD = 1000000007; double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define r...
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> constexpr long long INF = 1LL << 60; constexpr long long MOD = 1000000007; double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define r...
null
246,614
246,615
u281168735
cpp
p02550
#include <bits/stdc++.h> using namespace std; /// ----------------------------- (Debug) ------------------------------ #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeo...
#include <bits/stdc++.h> using namespace std; /// ----------------------------- (Debug) ------------------------------ #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeo...
null
246,635
246,636
u591816127
cpp
p02550
#include <bits/stdc++.h> #define boost_io \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define int long long #define num(a) a...
#include <bits/stdc++.h> #define boost_io \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define int long long #define num(a) a...
null
246,639
246,640
u087802159
cpp
p02550
#include <bits/stdc++.h> using namespace std; #define int long long int #define ff first #define ss second #define pb push_back #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define int long long int #define ff first #define ss second #define pb push_back #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
null
246,662
246,663
u908125903
cpp
p02550
// #pragma GCC target ("avx2") // #pragma GCC optimization ("O2") // #pragma GCC optimization ("unroll-loops") #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; // #define int ll #define pb push_back #define pob pop_back #define __bp __builtin_po...
// #pragma GCC target ("avx2") // #pragma GCC optimization ("O2") // #pragma GCC optimization ("unroll-loops") #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; // #define int ll #define pb push_back #define pob pop_back #define __bp __builtin_po...
null
246,673
246,674
u761382225
cpp
p02550
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <deque> #include <functional> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <complex> #include <numeric> #include <utility> #include <i...
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <deque> #include <functional> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <complex> #include <numeric> #include <utility> #include <i...
null
246,685
246,686
u592290074
cpp
p02550
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef vector<double> Vec; typedef vector<Vec> Mat; typedef pair<ll, ll> P; typedef pair<double, ll> Pd; typedef pair<double, double> PD; typedef priority_queue<P, vector<P>, greater...
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef vector<double> Vec; typedef vector<Vec> Mat; typedef pair<ll, ll> P; typedef pair<double, ll> Pd; typedef pair<double, double> PD; typedef priority_queue<P, vector<P>, greater...
null
246,689
246,690
u951952491
cpp
p02550
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = (a); i < (b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ALL(x) x.begin(), x.end() #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = m...
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = (a); i < (b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ALL(x) x.begin(), x.end() #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = m...
null
246,710
246,711
u174404613
cpp
p02550
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define eb emplace_back #define mp make_pair #define repi(n) for (int i = 0; i < (n); i++) #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define all(p) p.begin(), p.end() #define pop_count(p) __builtin_popcountll(p) #define len(s, e) ...
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define eb emplace_back #define mp make_pair #define repi(n) for (int i = 0; i < (n); i++) #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define all(p) p.begin(), p.end() #define pop_count(p) __builtin_popcountll(p) #define len(s, e) ...
null
246,728
246,729
u412232733
cpp
p02550
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
null
246,732
246,733
u487875527
cpp
p02550
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
null
246,734
246,733
u487875527
cpp
p02550
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Pine1999 */ #include <bits/stdc++.h> using namespace std; void ESequenceSum(std::istream &in, std::ostream &out) { long long n; in >> n; long long x, mod; in >> x >> mod; if (x == 1) { out << n % mod <<...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Pine1999 */ #include <bits/stdc++.h> using namespace std; void ESequenceSum(std::istream &in, std::ostream &out) { long long n; in >> n; long long x, mod; in >> x >> mod; if (x == 1) { out << n << '\n';...
null
246,755
246,756
u049708565
cpp
p02550
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<ll> offsets(m, -1); vector<int> idxs(m + 1), inv(m + 1); offsets[x] = 0; idxs[0] = x; inv[x] = 0; ll ai = x, sum...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; int main() { ll n, x, m; cin >> n >> x >> m; vector<ll> offsets(m, -1); vector<int> idxs(m + 1), inv(m + 1); offsets[x] = x; idxs[0] = x; inv[x] = 0; ll ai = x, sum...
null
246,757
246,758
u956758464
cpp
p02550
#include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define X first #define Y second #define nl '\n' #define AC return 0 #define pb(a) push_back(a) #define mst(a, b) memset(a, b, sizeof a) #define rep(i, n) for (int i = 0; (i) < (n); i++) #define rep1(i, n) for (int i = 1; (i) <= (n); ...
#include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define X first #define Y second #define nl '\n' #define AC return 0 #define pb(a) push_back(a) #define mst(a, b) memset(a, b, sizeof a) #define rep(i, n) for (int i = 0; (i) < (n); i++) #define rep1(i, n) for (int i = 1; (i) <= (n); ...
null
246,769
246,770
u403764487
cpp
p02550
// ===================================================== // File : main.cpp // Author : eezyl // Synopsis: codeforces/atcoder template v2 // Address : // Date : 2020/09/19 // ===================================================== #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespac...
// ===================================================== // File : main.cpp // Author : eezyl // Synopsis: codeforces/atcoder template v2 // Address : // Date : 2020/09/19 // ===================================================== #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespac...
null
246,781
246,782
u520069392
cpp
p02550
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } //最大公約数 ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数 using Graph = vector<vector<int>>; ll inf = 3000000000000000...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } //最大公約数 ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数 using Graph = vector<vector<int>>; ll inf = 3000000000000000...
null
246,783
246,784
u525560003
cpp
p02550
#pragma GCC optimize(2) #pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; #define fi first #define se second #define pb push_back #define wzh(x) cerr << #x << '=' << x << endl; LL n, x, m, s[N], a[N]; int pos[N]; int main() { ios::sync_with_stdio(false...
#pragma GCC optimize(2) #pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5 + 10; #define fi first #define se second #define pb push_back #define wzh(x) cerr << #x << '=' << x << endl; LL n, x, m, s[N], a[N]; int pos[N]; int main() { ios::sync_with_stdio(false...
null
246,978
246,979
u862237347
cpp
p02550
#include <bits/stdc++.h> //#include <atcoder/all> #define endl "\n" using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T ...
#include <bits/stdc++.h> //#include <atcoder/all> #define endl "\n" using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T ...
null
246,980
246,981
u980655160
cpp
p02550
#include "bits/stdc++.h" #define all_of(x) std::begin(x), std::end(x) #ifdef _GLIBCXX_DEBUG #define debug(x) cerr << #x << ": " << x << endl #else #define debug(x) #endif using namespace std; using LL = long long; template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) { out << "["; for (con...
#include "bits/stdc++.h" #define all_of(x) std::begin(x), std::end(x) #ifdef _GLIBCXX_DEBUG #define debug(x) cerr << #x << ": " << x << endl #else #define debug(x) #endif using namespace std; using LL = long long; template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) { out << "["; for (con...
null
246,985
246,986
u912077483
cpp
p02550
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N, X, M, S{0}; cin >> N >> X >> M; vector<pair<unsigned long, unsigned long>> memo(M); for (unsigned long i{0}; i < N; ++i) { if (memo[X].first) { const auto t{i - memo[X].first}, c{(N - i) / t}; i += t * c; S += (...
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N, X, M, S{0}; cin >> N >> X >> M; vector<pair<unsigned long, unsigned long>> memo(M); for (unsigned long i{0}; i < N; ++i) { if (memo[X].first) { const auto t{i - memo[X].first}, c{(N - i - 1) / t}; i += t * c; S ...
null
246,993
246,994
u462437857
cpp
p02550
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p_ll; template <class T> void debug(T itr1, T itr2) { auto now = itr1; while (now < itr2) { cout << *now << " "; now++; } cout << endl; } #define repr(i, from, to) for (ll i = (ll)from; i < (ll)to; i++) #define al...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p_ll; template <class T> void debug(T itr1, T itr2) { auto now = itr1; while (now < itr2) { cout << *now << " "; now++; } cout << endl; } #define repr(i, from, to) for (ll i = (ll)from; i < (ll)to; i++) #define al...
null
246,995
246,996
u680707192
cpp
p02550
#include <bits/stdc++.h> #define re register #define M 998244353 #define int long long inline void add(re int &x, re int y) { (x += y) >= M ? x -= M : x; } using namespace std; inline int read() { re int t = 0; re char v = getchar(); while (v < '0') v = getchar(); while (v >= '0') t = (t << 3) + (t << 1...
#include <bits/stdc++.h> #define re register #define M 998244353 #define int long long inline void add(re int &x, re int y) { (x += y) >= M ? x -= M : x; } using namespace std; inline int read() { re int t = 0; re char v = getchar(); while (v < '0') v = getchar(); while (v >= '0') t = (t << 3) + (t << 1...
null
246,997
246,998
u196974365
cpp
p02550
#include <bits/stdc++.h> #define re register #define M 998244353 #define int long long inline void add(re int &x, re int y) { (x += y) >= M ? x -= M : x; } using namespace std; inline int read() { re int t = 0; re char v = getchar(); while (v < '0') v = getchar(); while (v >= '0') t = (t << 3) + (t << 1...
#include <bits/stdc++.h> #define re register #define M 998244353 #define int long long inline void add(re int &x, re int y) { (x += y) >= M ? x -= M : x; } using namespace std; inline int read() { re int t = 0; re char v = getchar(); while (v < '0') v = getchar(); while (v >= '0') t = (t << 3) + (t << 1...
null
246,999
246,998
u196974365
cpp
p02550
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; const int mod = 998244353; ll n, x, m, ans, tp; int d[100001], a[100001]; int main() { cin >> n >> x >> m; d[x] = x, ans = x, a[1] = x; for (int i = 2; i <= ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; const int mod = 998244353; ll n, x, m, ans, tp; int d[100001], a[100001]; int main() { cin >> n >> x >> m; d[x] = 1, ans = x, a[1] = x; for (int i = 2; i <= ...
null
247,002
247,003
u771095147
cpp
p02551
#include <bits/stdc++.h> #include <algorithm> #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigned int)(n)) x++; return x; } // @param n...
#include <bits/stdc++.h> #include <algorithm> #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigned int)(n)) x++; return x; } // @param n...
null
247,025
247,026
u265065462
cpp
p02551
/*input 176527 15 1 81279 2 22308 2 133061 1 80744 2 44603 1 170938 2 139754 2 15220 1 172794 1 159290 2 156968 1 56426 2 77429 1 97459 2 71282 */ #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>; // AntBook p155 // Segment Tr...
/*input 176527 15 1 81279 2 22308 2 133061 1 80744 2 44603 1 170938 2 139754 2 15220 1 172794 1 159290 2 156968 1 56426 2 77429 1 97459 2 71282 */ #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>; // AntBook p155 // Segment Tr...
null
248,387
248,388
u965602776
cpp
p02551
#define fast \ ios::sync_with_stdio(false); \ cin.tie(0) #define foru(i, k, n) for (int i = k; i < n; i++) #define ford(i, k, n) for (int i = k; i >= n; i--) #define pb push_back #define mp make_pair ...
#define fast \ ios::sync_with_stdio(false); \ cin.tie(0) #define foru(i, k, n) for (int i = k; i < n; i++) #define ford(i, k, n) for (int i = k; i >= n; i--) #define pb push_back #define mp make_pair ...
null
248,428
248,429
u593641981
cpp
p02551
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
null
246,787
246,788
u107995903
cpp
p02551
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> ...
null
246,803
246,804
u049095189
cpp
p02552
#include <cstdio> int main() { int a; scanf("%d", &a); if (a == 0) putchar('0'); else if (a == 1) putchar('1'); return 0; }
#include <cstdio> int main() { int a; scanf("%d", &a); if (a == 1) putchar('0'); else if (a == 0) putchar('1'); return 0; }
null
247,082
247,083
u160841788
cpp
p02552
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x = 0) { cout << 1; } else { cout << 0; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1; } else { cout << 0; } }
null
247,102
247,103
u956695739
cpp
p02552
#include <algorithm> #include <iostream> #include <set> #include <string> using namespace std; int main() { int x; cin >> x; if (x == 1) { x = 0; cout << x << endl; } else { x == 1; cout << x << endl; } }
#include <algorithm> #include <iostream> #include <set> #include <string> using namespace std; int main() { int x; cin >> x; if (x == 1) { x = 0; cout << x << endl; } else { x = 1; cout << x << endl; } }
null
247,124
247,125
u622938720
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { int x; cout << 1 - x; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << 1 - x; return 0; }
null
247,149
247,150
u484731650
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int x; cout << !x << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int x; cin >> x; cout << !x << '\n'; return 0; }
null
247,176
247,177
u468434822
cpp
p02552
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == '0') { cout << 1 << endl; } else if (x == '1') { cout << 0 << endl; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1 << endl; } else if (x == 1) { cout << 0 << endl; } }
null
247,386
247,387
u055526866
cpp
p02552
#include <bits/stdc++.h> #define ll long long #define num_lim 10000 #define MAXN 100000 #define BIGN 1000000000 #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> #define ll long long #define num_lim 10000 #define MAXN 100000 #define BIGN 1000000000 #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
null
247,413
247,414
u951804920
cpp
p02552
#include <bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<int, int>; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int x; cin >> x; cout << (x == 1) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<int, int>; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int x; cin >> x; cout << (!x) << endl; return 0; }
null
247,417
247,418
u397571120
cpp
p02552
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int x; cin >> x; if (x = 0) { cout << 1 << endl; } else { cout << 0 << endl; } }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1 << endl; } else { cout << 0 << endl; } }
null
247,451
247,452
u877829177
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << ~x << endl; }
#include <bits/stdc++.h> using namespace std; int main() { bitset<1> x; cin >> x; cout << (~x) << endl; }
null
247,457
247,458
u590995678
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << ~x << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << !x << endl; }
null
247,457
247,459
u590995678
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << ~x << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << (x ^ 1) << endl; }
null
247,457
247,460
u590995678
cpp
p02552
#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; void debug_out() { cerr << endl; } template <class T> ostream &prnt(ostream &out, T v) { out << v.size() << '\n'; for (auto e : v) out << e << ' '; return o...
#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; void debug_out() { cerr << endl; } template <class T> ostream &prnt(ostream &out, T v) { out << v.size() << '\n'; for (auto e : v) out << e << ' '; return o...
null
247,465
247,466
u454937339
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n) cout << n - 1 << endl; else cout << "0" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n) cout << n - 1 << endl; else cout << "1" << endl; }
null
247,371
247,372
u723744542
cpp
p02552
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; #define fi first #define se second #define pb push_back #define sz(x) (int)((x).size()) #define fast \ ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; #define fi first #define se second #define pb push_back #define sz(x) (int)((x).size()) #define fast \ ...
null
247,381
247,382
u340822596
cpp
p02552
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265 #define seive_len 1000001 typedef long long int lli; bool seive[seive_len]; lli primeSeive[seive_len]; lli gcd(lli a, lli b) { if (b == 0) return a; return gcd(b, a % b); } lli lcm(lli a, lli b) { lli gcd_ = gcd(a, b); lli lcm_ = (a * b...
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265 #define seive_len 1000001 typedef long long int lli; bool seive[seive_len]; lli primeSeive[seive_len]; lli gcd(lli a, lli b) { if (b == 0) return a; return gcd(b, a % b); } lli lcm(lli a, lli b) { lli gcd_ = gcd(a, b); lli lcm_ = (a * b...
null
247,467
247,468
u908484929
cpp
p02552
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x = 1) { cout << "0" << endl; } else if (x = 0) { cout << "1" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x == 1) { cout << "0" << endl; } else if (x == 0) { cout << "1" << endl; } }
null
247,600
247,601
u391690058
cpp
p02552
#include <iostream> using namespace std; int main() { int x, j = x; if ((x >= 0) && (x <= 1)) { if (x == 0) cout << "1" << endl; else if (x == 1) cout << "0" << endl; else cout << "Invalid Input!\n"; } else { cout << "Invalid" << endl; } return 0; }
#include <iostream> using namespace std; int main() { int x, j = x; cin >> x; if ((x >= 0) && (x <= 1)) { if (x == 0) cout << "1" << endl; else if (x == 1) cout << "0" << endl; else cout << "Invalid Input!\n"; } else { cout << "Invalid" << endl; } return 0; }
null
247,606
247,607
u538882789
cpp
p02552
#include <bits/stdc++.h> #define ll long long #define MOD 100000007 using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int x; cout << ~x << "\n"; return 0; }
#include <bits/stdc++.h> #define ll long long #define MOD 100000007 using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int x; cin >> x; cout << !x << "\n"; return 0; }
null
247,758
247,759
u219305322
cpp
p02552
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; if (n == 0) { cout << 1; } else {...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; if (n == 0) { cout << 1; } else {...
null
247,801
247,802
u810516743
cpp
p02552
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define deb(x) cout << #x << " = " << x << endl #define all(x) x.begin(), x.end() #define sortall(x) sort(all(x)) #define tr(it, a) for (auto it = a.begin(); it != a.end(); it++) #define debv(x) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define deb(x) cout << #x << " = " << x << endl #define all(x) x.begin(), x.end() #define sortall(x) sort(all(x)) #define tr(it, a) for (auto it = a.begin(); it != a.end(); it++) #define debv(x) ...
null
247,963
247,964
u887560595
cpp
p02552
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long int; using namespace std; 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; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long int; using namespace std; 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; ...
null
248,144
248,145
u167245594
cpp
p02552
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define pb push_back #define eb emplace_back #define mp make_pair #define ff first #define ss second #define ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define pb push_back #define eb emplace_back #define mp make_pair #define ff first #define ss second #define ...
null
248,097
248,098
u903285404
cpp
p02552
// c++ -std=gnu++14 a.cpp #include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #in...
// c++ -std=gnu++14 a.cpp #include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #in...
null
248,169
248,170
u633284019
cpp
p02553
#include <algorithm> #include <cstdlib> #include <iostream> int main() { int a, b, c, d; int m1, m2, m3, m4; std::cin >> a >> b >> c >> d; m1 = a * c; m2 = a * d; m3 = b * c; m4 = b * d; std::cout << std::max({m1, m2, m3, m4}) << "\n"; return 0; }
#include <algorithm> #include <cstdlib> #include <iostream> int main() { long long int a, b, c, d; long long int m1, m2, m3, m4; std::cin >> a >> b >> c >> d; m1 = a * c; m2 = a * d; m3 = b * c; m4 = b * d; std::cout << std::max({m1, m2, m3, m4}) << "\n"; return 0; }
null
248,430
248,431
u644265148
cpp
p02553
/*** @ Author : RobsonChen @ Date : 2020-09-20 19:35:23 @ LastEditTime : 2020-09-20 22:40:03 @ Got AC : Σ(っ °Д °;)っ */ #include <bits/stdc++.h> using namespace std; typedef unsigned int INT; typedef unsigned long long LONG; typedef long long LL; typedef pair<int, int> PII; const int N = 1e5 + 1...
/*** @ Author : RobsonChen @ Date : 2020-09-20 19:35:23 @ LastEditTime : 2020-09-20 22:40:03 @ Got AC : Σ(っ °Д °;)っ */ #include <bits/stdc++.h> using namespace std; typedef unsigned int INT; typedef unsigned long long LONG; typedef long long LL; typedef pair<int, int> PII; const int N = 1e5 + 1...
null
248,445
248,446
u703460662
cpp
p02553
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int64_t a, b, c, d; cin >> a >> b >> c >> d; int64_t t1, t2, t3, t4; t1 = a * c; t2 = a * d; t3 = b * c; t4 = b * d; int64_t max = t1; if (max < t2) { max = t2; } if (max < t3) { ...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int64_t a, b, c, d; cin >> a >> b >> c >> d; int64_t t1, t2, t3, t4; t1 = a * c; t2 = a * d; t3 = b * c; t4 = b * d; int64_t max = t1; if (max < t2) { max = t2; } if (max < t3) { ...
null
248,450
248,451
u127364468
cpp
p02553
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int n1 = (a * c), n2 = (a * d); int n3 = (b * c), n4 = (b * d); int ans = max(max(n1, n2), max(n3, n4)); cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; #define int long long int signed main() { int a, b, c, d; cin >> a >> b >> c >> d; int n1 = (a * c), n2 = (a * d); int n3 = (b * c), n4 = (b * d); int ans = max(max(n1, n2), max(n3, n4)); cout << ans; return 0; }
null
248,454
248,455
u786919875
cpp