buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <vector> using namespace std; typedef long long LL; #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) template <typename T1, typename T2> inline void chmin(T1 &a, T...
#include <bits/stdc++.h> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <vector> using namespace std; typedef long long LL; #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) template <typename T1, typename T2> inline void chmin(T1 &a, T...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
348
#include <bits/stdc++.h> using namespace std; #include <cstdlib> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) typedef long long ll; int main() { ll n; int x, m; cin >> n >> x >> m; vector<int> check(m + 5, 0); vector<ll> suma(m + 5, 0); vector<ll> a(m + 5); a.at(1) = x; suma.at(1) = x; chec...
#include <bits/stdc++.h> using namespace std; #include <cstdlib> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) typedef long long ll; int main() { ll n; int x, m; cin >> n >> x >> m; vector<int> check(m + 5, 0); vector<ll> suma(m + 5, 0); vector<ll> a(m + 5); a.at(1) = x; suma.at(1) = x; chec...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
396
/// BISMILLAHIR RAHMANIR RAHEEM /// ALLAH IS WATCHING ME /// ALLAH save us from COVID-19.Amin. /// Every soul shall taste death. /// Tag :: #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> /// order_of...
/// BISMILLAHIR RAHMANIR RAHEEM /// ALLAH IS WATCHING ME /// ALLAH save us from COVID-19.Amin. /// Every soul shall taste death. /// Tag :: #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> /// order_of...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
1,289
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; long long memo[100010] = {0}, me...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; long long memo[100010] = {0}, me...
[["+", 8, 9, 0, 7, 15, 16, 12, 2, 63, 22], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25]]
1
247
#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...
#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 < (ll)(n); ++i) #define rrep(i, j, n) for (int i = (int)(n)-1;...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59]]
1
387
#include <bits/stdc++.h> using namespace std; typedef long long ll; const static ll INF = 1e15; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // __uint128_t const ll MOD = 998244353; ll f(ll X, ll M) { return X % M; } int main() { ll N, X, M; cin >> N >> X >> M; ll SUM = X; vector<ll> A; A.push_back(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const static ll INF = 1e15; #define rep(i, n) for (int i = 0; i < (int)(n); i++) // __uint128_t const ll MOD = 998244353; ll f(ll X, ll M) { return X % M; } int main() { ll N, X, M; cin >> N >> X >> M; ll SUM = X; vector<ll> A; A.push_back(...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
294
#include <bits/stdc++.h> #define INF 1e9 #define INFLL 1ull << 60u using namespace std; #define REPR(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() #define endl "\n" temp...
#include <bits/stdc++.h> #define INF 1e9 #define INFLL 1ull << 60u using namespace std; #define REPR(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() #define endl "\n" temp...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25]]
1
459
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> ...
#include <iostream> #include <stdio.h> //#include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> ...
[["-", 0, 9, 0, 1, 0, 11, 31, 2, 63, 22], ["+", 0, 9, 0, 1, 0, 11, 31, 2, 63, 22], ["-", 0, 1, 0, 11, 31, 2, 3, 4, 0, 21], ["-", 0, 1, 0, 11, 31, 2, 3, 4, 0, 22], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 31, 22], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 72]]
1
405
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; #define REP(i, n, m) for (ll i = n; i < (ll)m; ++i) #define IREP(i, n, m) for (ll i = n - 1; i >= m; --i) #define rep(i, n) REP(i, 0, n) #define irep(i, n) IREP(i, n, 0) #d...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; #define REP(i, n, m) for (ll i = n; i < (ll)m; ++i) #define IREP(i, n, m) for (ll i = n - 1; i >= m; --i) #define rep(i, n) REP(i, 0, n) #define irep(i, n) IREP(i, n, 0) #d...
[["-", 0, 11, 31, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 11, 31, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 11, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 31, 2, 3, 4, 0, 22]]
1
395
n,x,m = map(int,input().split()) mod = m num = [] ans = 0 cnt = 0 ch = x #ループの始まりを特定 while True: if ch not in num: num.append(ch) else: st = ch #ループの開始している配列の初めの数字 break ch *= ch ch %= mod #ループの始まりの配列の添え字を特定 for i in range(len(num)): if num[i] == st: stnum = i #ループ開...
n,x,m = map(int,input().split()) mod = m num = [] ans = 0 cnt = 0 ch = x #ループの始まりを特定 while True: if ch not in num: num.append(ch) else: st = ch #ループの開始している配列の初めの数字 break ch *= ch ch %= mod #ループの始まりの配列の添え字を特定 for i in range(len(num)): if num[i] == st: stnum = i #ループ開...
[["-", 0, 1, 0, 662, 12, 657, 12, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 12, 22]]
5
225
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; ll f, r; f = r = 0; ll p, p2; p = p2 = x; for (ll i = 0; i < 2 * m; ++i) { (p *= p) %= m; (p2 *= p2) %= m; (p2 *= p2) %= m; if (p == p2) break; } ll sf = 0; p = x;...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; ll f, r; f = r = 0; ll p, p2; p = p2 = x; for (ll i = 0; i < 2 * m; ++i) { (p *= p) %= m; (p2 *= p2) %= m; (p2 *= p2) %= m; if (p == p2) break; } ll sf = 0; p = x;...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22]]
1
305
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
1,881
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { 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] = ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { ll n, x, m; cin >> n >> x >> m; vector<int> id(m, -1); vector<int> a; ll len = 0, tot = 0; while (id[x] == -1) { a.push_back(x); id[x] = len; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 11, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 85]]
1
234
n, x, m = map(int, input().split()) lst, num, frag = set(), [], False for i in range(1, n + 1): lst.add(x), num.append(x) x = x ** 2 % m if x in lst: flag = True break ans = sum(num) if flag: cnt, idx = i, num.index(x) div, mod = divmod(n - cnt, len(num) - idx) ans += sum(num[i...
n, x, m = map(int, input().split()) lst, num, flag = set(), [], False for i in range(1, n + 1): lst.add(x), num.append(x) x = x ** 2 % m if x in lst: flag = True break ans = sum(num) if flag: cnt, idx = i, num.index(x) div, mod = divmod(n - cnt, len(num) - idx) ans += sum(num[i...
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22]]
5
140
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int NMAX = 2e5 + 10; const int MOD = 1e9 + 7; ll loc[NMAX]; ll pre_sum[NMAX]; int main(int argc, char const *argv[]) { ll n, ans = 0; ll x, m, pos; scanf("%lld%lld%lld", &n, &x, &m); loc[x] = 1; pre_sum[1] = x; for (register ll i = 2...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int NMAX = 2e5 + 10; const int MOD = 1e9 + 7; ll loc[NMAX]; ll pre_sum[NMAX]; int main(int argc, char const *argv[]) { ll n, ans = 0; ll x, m, pos = 1; scanf("%lld%lld%lld", &n, &x, &m); loc[x] = 1; pre_sum[1] = x % m; for (register ...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
314
// =========== Template ========== // #include <bits/stdc++.h> using namespace std; int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; } int __fastio = fastio(); template <typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p); ...
// =========== Template ========== // #include <bits/stdc++.h> using namespace std; int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; } int __fastio = fastio(); template <typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 64, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 64, 9, 0, 57, 64, 9, 0, 43, 39, 78]]
1
5,571
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); long n = sc.nextLong(); int x = sc.nextInt(); int m = sc.nextInt(); if (n == 1) { o...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); long n = sc.nextLong(); int x = sc.nextInt(); int m = sc.nextInt(); if (m == 1) { o...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 31, 22], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 31, 22], ["-", 0, 57, 75, 57, 15, 15, 0, 16, 31, 22], ["+", 0, 57, 75, 57, 15, 15, 0, 16, 31, 22], ["-", 0, 57, 64, 196, 0, 7, 15, 16, 17, 19], ["+", 0, 57, 64, 196, 0, 7, 15, 16, 17, 18]]
3
701
#include <bits/stdc++.h> using namespace std; #define ll long long int const ll sz = 5e5 + 100; ll sum[sz]; ll mod; ll ans = 0; map<ll, ll> mp; ll Fun(ll x) { ll p = ((sum[x - 1]) * (sum[x - 1])) % mod; sum[x] = p; ans += p; return p; } int main() { ll x, n; cin >> n >> x >> mod; sum[1] = x; ll...
#include <bits/stdc++.h> using namespace std; #define ll long long int const ll sz = 5e5 + 100; ll sum[sz]; ll mod; ll ans = 0; map<ll, ll> mp; ll Fun(ll x) { ll p = ((sum[x - 1]) * (sum[x - 1])) % mod; sum[x] = p; ans += p; return p; } int main() { ll x, n; cin >> n >> x >> mod; sum[1] = x; ll...
[["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
341
#include <bits/stdc++.h> #define ll long long int #define pb push_back #define endl '\n' #define Endl '\n' #define fi first #define ii pair<int, int> #define iil pair<ll, ll> #define se second #define ld long double #define mod 1000000007 #define popcount __builtin_popcountll #define x0 zxcxzcsacasd #define x1 ghfghujf...
#include <bits/stdc++.h> #define ll long long int #define pb push_back #define endl '\n' #define Endl '\n' #define fi first #define ii pair<int, int> #define iil pair<ll, ll> #define se second #define ld long double #define mod 1000000007 #define popcount __builtin_popcountll #define x0 zxcxzcsacasd #define x1 ghfghujf...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
318
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #define mod (int)998244353 #define int long long using namespace std; #define INF (int)pow(2, 32) - 1 #define FAST \ ios_base::sync_with_stdio(false); ...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #define mod (int)998244353 #define int long long using namespace std; #define INF (int)pow(2, 32) - 1 #define FAST \ ios_base::sync_with_stdio(false); ...
[["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25]]
1
1,016
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #defi...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #defi...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
431
N, X, M = map(int, input().split()) A_change_list = [0] * (M + 1) check_list = [0] * (M + 1) for i in range(1, M + 1): A_change_list[i] = i**2 % M A = X count = 0 sum_value = 0 ans = 0 for i in range(1, N + 1): if check_list[A] != 2: if check_list[A] == 1: count += 1 sum_value...
N, X, M = map(int, input().split()) A_change_list = [0] * (M + 1) check_list = [0] * (M + 1) for i in range(1, M + 1): A_change_list[i] = i**2 % M A = X count = 0 sum_value = 0 ans = 0 for i in range(1, N + 1): if check_list[A] != 2: if check_list[A] == 1: count += 1 sum_value...
[["+", 64, 196, 0, 1, 0, 677, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 677, 12, 657, 12, 612]]
5
187
n,x,m=map(int,input().split()) a=[x] su=x s={x} for i in range(n): x=(x**2)%m if x in s: n-=i+1 a=a[a.index(x):] l=len(a) su+=sum(a)*(n//l) n-=(n//l)*l su+=sum(a[:n]) print(su) exit() a.append(x) su+=x s.add(x) print(su)
n,x,m=map(int,input().split()) a=[x] su=x s={x} for i in range(n-1): x=(x**2)%m if x in s: n-=i+1 a=a[a.index(x):] l=len(a) su+=sum(a)*(n//l) n-=(n//l)*l su+=sum(a[:n]) print(su) exit() a.append(x) su+=x s.add(x) print(su)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
133
// https://atcoder.jp/contests/abc179/submissions/16845772 #include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; int main() { ll n, q; cin >> n >> q; vector<ll> a(n + 1), b(n + 1); for (int i = 1; i <= n; i++) { a[i] = b[i] = n; } ll black = ll(n - 2) * ll(n - 2...
// https://atcoder.jp/contests/abc179/submissions/16845772 #include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; int main() { ll n, q; cin >> n >> q; vector<ll> a(n + 1), b(n + 1); for (int i = 1; i <= n; i++) { a[i] = b[i] = n; } ll black = ll(n - 2) * ll(n - 2...
[["-", 64, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 64, 9, 0, 7, 10, 43, 49, 50, 51, 22]]
1
243
#include <algorithm> #include <array> #include <bitset> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <vector> long long mod = 1e9 + 7; class Mint { pub...
#include <algorithm> #include <array> #include <bitset> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <vector> long long mod = 1e9 + 7; class Mint { pub...
[["+", 0, 37, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 37, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,499
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; int main() { int n, q; cin >> n >> q; ll sol = (n - 2) * (n - 2); int rows[n + 1], cols[n + 1]; int topRow = n, topCol = n; for (int i = 1; i <= n; i++) { rows[i] = n; cols[i] = n; } while (q--) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; int main() { int n, q; cin >> n >> q; ll sol = (n - 2) * 1LL * (n - 2); int rows[n + 1], cols[n + 1]; int topRow = n, topCol = n; for (int i = 1; i <= n; i++) { rows[i] = n; cols[i] = n; } while (q--...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48]]
1
229
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() x = na() print(1 if x==0 else 0)
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() x = ni() print(1 if x==0 else 0)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
90
#str型で受け取るとき #s = input() #int型で受け取るとき #s = int(input()) #float型 (小数)で受け取るとき #s = float(input()) s=int(input()) if 0 < s: print(1) else: print(0)
s=int(input()) if 0 == s: print(1) else: print(0)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60]]
5
29
#include <bits/stdc++.h> using namespace std; int x; int main() { cin >> x; if (x == 0) cout << 1; else cout << 1; return 0; }
#include <bits/stdc++.h> using namespace std; int x; int main() { cin >> x; if (x == 0) cout << 1; else cout << 0; return 0; }
[["-", 0, 57, 75, 76, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 12, 13]]
1
37
a=int(input()) if a==1: print(0) else: print(10)
a=int(input()) if a==1: print(0) else: print(1)
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
23
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n >= 0) cout << "1" << endl; else cout << "0" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1) cout << "0" << endl; else cout << "1" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0,...
1
42
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 1) cout << 1 << endl; else cout << 0 << endl; return 0; }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x != 1) cout << 1 << endl; else cout << 0 << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
41
#include <bits/stdc++.h> using namespace std; template <typename T, typename U> void cmax(T &a, U b) { if (a < b) a = b; } template <typename T, typename U> void cmin(T &a, U b) { if (a > b) a = b; } signed main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int N; cin >> N; cout << ((...
#include <bits/stdc++.h> using namespace std; template <typename T, typename U> void cmax(T &a, U b) { if (a < b) a = b; } template <typename T, typename U> void cmin(T &a, U b) { if (a > b) a = b; } signed main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int N; cin >> N; cout << ((...
[["-", 0, 16, 31, 16, 12, 23, 0, 41, 64, 13], ["-", 0, 16, 31, 16, 12, 23, 0, 41, 0, 102], ["+", 0, 16, 31, 16, 12, 23, 0, 41, 0, 102], ["+", 0, 16, 31, 16, 12, 23, 0, 41, 75, 13]]
1
109
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; cout << (X ? 1 : 0) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int X; cin >> X; cout << (X ? 0 : 1) << endl; }
[["-", 0, 16, 31, 16, 12, 23, 0, 41, 64, 13], ["-", 0, 16, 31, 16, 12, 23, 0, 41, 0, 102], ["+", 0, 16, 31, 16, 12, 23, 0, 41, 0, 102], ["+", 0, 16, 31, 16, 12, 23, 0, 41, 75, 13]]
1
31
n = int(input()) if(n == 0): printf(1) if(n == 1): printf(0)
n = int(input()) if(n == 0): print(1) elif(n == 1): print(0)
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683], ["+", 75, 665, 64, 196, 0, 1, 0, 652, 63, 22]]
5
30
s = int(input()) if s != 0: print("1"); else: print("0");
s = int(input()) if s != 0: print("0"); else: print("1");
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
29
#include <stdio.h> int main() { int a; scanf("%d", &a); if (a == 0) printf("%d", 0); else if (a == 1) printf("%d", 1); return 0; }
#include <stdio.h> int main() { int a; scanf("%d", &a); if (a == 0) printf("%d", 1); else if (a == 1) printf("%d", 0); return 0; }
[["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 13]]
0
55
#include <bits/stdc++.h> using namespace std; #define ll long long int #define inf std::numeric_limits<double>::infinity() #define DECI(n) fixed << showpoint << setprecision(n) #define MOD 1000000007LL #define FOR(i, start, end) for (int i = start; i < end; i++) #define FORR(i, end, start) for (int i = end - 1; i > sta...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define inf std::numeric_limits<double>::infinity() #define DECI(n) fixed << showpoint << setprecision(n) #define MOD 1000000007LL #define FOR(i, start, end) for (int i = start; i < end; i++) #define FORR(i, end, start) for (int i = end - 1; i > sta...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 12, 13]]
1
189
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x = 0) { cout << 1; } if (x = 1) { cout << 0; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1; } if (x == 1) { cout << 0; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
46
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x = 1) { cout << "0" << endl; } else if (x = 0) { cout << "1" << endl; } return 0; }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 1) { cout << "0" << endl; } else if (x == 0) { cout << "1" << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 75, 76, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 60]]
1
55
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x == 1) { cout << 0; } if (x == 1) { cout << 1; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x == 1) { cout << 0; } if (x == 0) { cout << 1; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
46
#include <stdio.h> int main(void) { int X, K = 0, J = 1; scanf("%d", &X); if (X == 0) printf("%d\n", J); else printf("%d\n", X); return 0; }
#include <stdio.h> int main(void) { int X, K = 0, J = 1; scanf("%d", &X); if (X == 0) printf("%d\n", J); else printf("%d\n", K); return 0; }
[["-", 75, 76, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 75, 76, 0, 1, 0, 2, 3, 4, 0, 22]]
0
60
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array void solve() {} int main() { ios::sync_with_stdio(0); cin.tie(0); int x; cin >> x; cout << ~x; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array void solve() {} int main() { ios::sync_with_stdio(0); cin.tie(0); bool x; cin >> x; cout << !x; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 16, 12, 91, 17, 92], ["+", 8, 9, 0, 1, 0, 16, 12, 91, 17, 111]]
1
50
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { int x; cout << (x ? 0 : 1) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { int x; cin >> x; cout << (x ? 0 : 1) << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
37
x=str(input()) if x==1: print("0") elif x==0: print("1")
x=int(input()) if x==1: print("0") if x==0: print("1")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121]]
5
30
x = int(input()) if x>=0: print(1) else: print(0)
x = int(input()) if x==0: print(1) else: print(0)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60]]
5
23
<?php $x = fgets(STDIN); if($x){ $x=0; } else { $x=1; } echo $x;
<?php $x = fgets(STDIN); if($x==1){ $x=0; } else { $x=1; } echo $x;
[["+", 0, 493, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 493, 0, 57, 15, 23, 0, 16, 12, 612]]
6
33
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int x = in.nextInt(); int ans = atCoder(x); System.out.println("Answer = " + ans); } public static int atCoder(int x) { if (x == 0) { return 1; } else if (x == ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int x = in.nextInt(); int ans = atCoder(x); System.out.println(ans); } public static int atCoder(int x) { if (x == 0) { return 1; } else if (x == 1) { ret...
[["-", 0, 492, 3, 4, 0, 16, 31, 5, 0, 62], ["-", 0, 492, 3, 4, 0, 16, 31, 5, 0, 491], ["-", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72]]
3
101
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x = 0) { cout << "1" << endl; } if (x = 1) { cout << "0" << endl; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1 << endl; } if (x == 1) { cout << 0 << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62]]
1
51
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x = 0) { cout << "1" << endl; } if (x = 1) { cout << "0" << endl; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << "1" << endl; } if (x == 1) { cout << "0" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
51
n = int(input()) print(n&1)
n = int(input()) print(n^1)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 67], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 140]]
5
14
n = int(input()) print(0 if n == 1 else n)
n = int(input()) print(0 if n == 1 else 1)
[["-", 0, 1, 0, 652, 3, 4, 0, 41, 0, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 41, 0, 612]]
5
18
#include <bits/stdc++.h> using namespace std; #define ll long long #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define fill(a, b) memset(a, b, sizeof(a)) #define f first #define s second #define pb push_back #define inf 1e17 #define ninf -1 * 1e17 #define mod 1000000007 #define N 500005 #...
#include <bits/stdc++.h> using namespace std; #define ll long long #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define fill(a, b) memset(a, b, sizeof(a)) #define f first #define s second #define pb push_back #define inf 1e17 #define ninf -1 * 1e17 #define mod 1000000007 #define N 500005 #...
[["-", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13]]
1
151
N, X, M = map(int, input().split()) candicate = [pow(i, 2, M) for i in range(M)] ans = 0 now = X A = [0] X2 = pow(X, 2, M) d = dict() flag = True for i in range(1, N): if i == 1: A.append(X) else: nxt = candicate[A[i-1]] if d.get(nxt) == None: if nxt == 0: ...
N, X, M = map(int, input().split()) candicate = [pow(i, 2, M) for i in range(M)] ans = 0 now = X A = [0] X2 = pow(X, 2, M) d = dict() flag = True for i in range(1, N+1): if i == 1: A.append(X) else: nxt = candicate[A[i-1]] if d.get(nxt) == None: if nxt == 0: ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
249
#include <bits/stdc++.h> //#include <atcoder/all> using namespace std; // using namespace atcoder; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rep1(i, n) FOR(i, 1, n + 1) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x)....
#include <bits/stdc++.h> //#include <atcoder/all> using namespace std; // using namespace atcoder; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rep1(i, n) FOR(i, 1, n + 1) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x)....
[["-", 0, 7, 8, 9, 0, 57, 64, 37, 0, 38], ["-", 0, 7, 8, 9, 0, 57, 64, 37, 0, 13], ["+", 0, 7, 8, 9, 0, 57, 64, 93, 0, 94]]
1
408
# -*- coding: utf-8 -*- def get_input() -> tuple: """ 標準入力を取得する. Returns:\n tuple: 標準入力 """ # 標準入力を取得 N, X, M = list(map(int, input().split())) return N, X, M def f(x: int, m: int) -> int: """ xをmで割った余りを返す. Args:\n x (int): 整数 m (int): 整数 Return...
# -*- coding: utf-8 -*- def get_input() -> tuple: """ 標準入力を取得する. Returns:\n tuple: 標準入力 """ # 標準入力を取得 N, X, M = list(map(int, input().split())) return N, X, M def f(x: int, m: int) -> int: """ xをmで割った余りを返す. Args:\n x (int): 整数 m (int): 整数 Return...
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 578], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
236
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) FOR(i, 0, n) #define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() #define ALLR(obj) (obj).rbegin(), (obj).rend() #define CEIL(a, b) ((a - 1) / b + 1) void solve() { int...
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) FOR(i, 0, n) #define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() #define ALLR(obj) (obj).rbegin(), (obj).rend() #define CEIL(a, b) ((a - 1) / b + 1) void solve() { int...
[["+", 51, 16, 31, 23, 0, 16, 31, 16, 12, 13], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33]]
1
208
#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() { ios::sync_with_stdio(false); cin.tie(nullptr); ll n; ll x, m; cin >> n >> x >> m; vector<ll> cnt(m, -1), c; ll ans = 0; ll num = x; ll sum = 0; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll n; ll x, m; cin >> n >> x >> m; vector<ll> cnt(m, -1), c; ll ans = 0; ll num = x; ll sum = 0; ...
[["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
304
N,X,M = map(int,input().split()) #全体ループを見る配列 t_loop = [X] #初回ループを見る配列 f_loop = [X] #出現回数を見る辞書 memo = {X:1} #2回目以降のループを見る配列 s_loop = [] while True: new_val = t_loop[-1]**2%M t_loop.append(new_val) if new_val not in f_memo: memo[new_val] = 1 f_loop.append(new_val) else: memo[new_va...
N,X,M = map(int,input().split()) #全体ループを見る配列 t_loop = [X] #初回ループを見る配列 f_loop = [X] #出現回数を見る辞書 memo = {X:1} #2回目以降のループを見る配列 s_loop = [] while True: new_val = t_loop[-1]**2%M t_loop.append(new_val) if new_val not in memo: memo[new_val] = 1 f_loop.append(new_val) else: memo[new_val]...
[["-", 0, 52, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 52, 8, 196, 0, 57, 15, 666, 0, 22]]
5
187
n,x,m=map(int, input().split()) a=x ans=a flg=[0]*m flg[a]=1 l=[a] lp=0 for i in range(1,m+1): if n <= i: break tmp=(a*a)%m a=tmp if flg[a]==1: lp = l.index(a) break else: ans+=tmp l.append(a) flg[a]=1 if lp != 0: l2 = l[lp:] tmp = sum...
n,x,m=map(int, input().split()) a=x ans=a flg=[0]*m flg[a]=1 l=[a] lp=-1 for i in range(1,m+1): if n <= i: break tmp=(a*a)%m a=tmp if flg[a]==1: lp = l.index(a) break else: ans+=tmp l.append(a) flg[a]=1 if lp != -1: l2 = l[lp:] tmp = s...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 664, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 664, 28, 612], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 666, 0, 664, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 664, 28, 612]]
5
179
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
[["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
2,938
// g++ -std=c++11 a.cpp #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <typeinfo> #incl...
// g++ -std=c++11 a.cpp #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <typeinfo> #incl...
[["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
548
# Date [ 2020-09-19 21:46:14 ] # Problem [ e.py ] # Author Koki_tkg import sys # import math # import bisect # import numpy as np # from decimal import Decimal # from numba import njit, i8, u1, b1 #JIT compiler # from itertools import combinations, product # from collections import Counter, deque, defaultdict # sys.s...
# Date [ 2020-09-19 21:46:14 ] # Problem [ e.py ] # Author Koki_tkg import sys # import math # import bisect # import numpy as np # from decimal import Decimal # from numba import njit, i8, u1, b1 #JIT compiler # from itertools import combinations, product # from collections import Counter, deque, defaultdict # sys.s...
[["+", 12, 657, 12, 23, 0, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 657, 12, 657, 12, 23, 0, 25]]
5
365
# -*- coding: utf-8 -*- N, X, M = map(int, input().split()) mod_check_list = [False for _ in range(M)] mod_list = [(X ** 2) % M] counter = 1 mod_sum = (X ** 2) % M last_mod = 0 for i in range(M): now_mod = (mod_list[-1] ** 2) % M if mod_check_list[now_mod]: last_mod = now_mod break mod_chec...
# -*- coding: utf-8 -*- N, X, M = map(int, input().split()) mod_check_list = [False for _ in range(M)] mod_list = [(X ** 2) % M] counter = 1 mod_sum = (X ** 2) % M last_mod = 0 for i in range(M): now_mod = (mod_list[-1] ** 2) % M if mod_check_list[now_mod]: last_mod = now_mod break mod_chec...
[["+", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 25], ["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 22], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 31, 22], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 1...
5
233
""" 何回足されるかで考えればよい。 真っ二つに切っていく。 各項は必ずM未満。 M項以内に必ずループが現れる。 """ N,X,M = map(int,input().split()) memo1 = set() memo2 = [] ans = 0 a = X flag = True rest = N while rest > 0: if a in memo1 and flag: flag = False for i in range(len(memo2)): if memo2[i] == a: loopStart = i ...
""" 何回足されるかで考えればよい。 真っ二つに切っていく。 各項は必ずM未満。 M項以内に必ずループが現れる。 """ N,X,M = map(int,input().split()) memo1 = set() memo2 = [] ans = 0 a = X flag = True rest = N while rest > 0: if a in memo1 and flag: flag = False for i in range(len(memo2)): if memo2[i] == a: loopStart = i ...
[["+", 0, 52, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 52, 8, 196, 0, 57, 75, 76, 0, 102]]
5
157
import static java.lang.System.out; import java.io.*; import java.util.*; public class Main { static MyReader in = new MyReader(); public static void main(String[] args) { long N = in.l(); int X = in.i(); int M = in.i(); long ans = -1; long a = X; long[] sum = new long[M + 1]; sum[1...
import static java.lang.System.out; import java.io.*; import java.util.*; public class Main { static MyReader in = new MyReader(); public static void main(String[] args) { long N = in.l(); int X = in.i(); int M = in.i(); long ans = -1; long a = X; long[] sum = new long[M + 2]; sum[1...
[["-", 49, 200, 51, 227, 497, 505, 0, 16, 12, 499], ["+", 49, 200, 51, 227, 497, 505, 0, 16, 12, 499]]
3
791
n, x, m = map(int, input().split()) ans = 0 loop_list = [0] * m loop_list[x] = 1 order_list = [x] for i in range(1, m + 1): x = pow(x, 2, m) if loop_list[x] != 1: loop_list[x] = 1 order_list.append(x) else: break index = order_list.index(x) time = (n - index) // (len(order_list) -...
n, x, m = map(int, input().split()) ans = 0 loop_list = [0] * m loop_list[x] = 1 order_list = [x] for i in range(1, m + 1): x = pow(x, 2, m) if loop_list[x] != 1: loop_list[x] = 1 order_list.append(x) else: break index = order_list.index(x) time = (n - index) // (len(order_list) -...
[["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
167
import sys #import numpy as np import math #from fractions import Fraction import itertools from collections import deque from collections import Counter import heapq from math import gcd #input=sys.stdin.readline #import bisect n,x,m=map(int,input().split()) s=[x] g=set() cnt=0 l=-1 g.add(x) b=x for i in range(1,n): ...
import sys #import numpy as np import math #from fractions import Fraction import itertools from collections import deque from collections import Counter import heapq from math import gcd #input=sys.stdin.readline #import bisect n,x,m=map(int,input().split()) s=[x] g=set() cnt=0 l=-1 g.add(x) b=x for i in range(1,n): ...
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72]]
5
230
#include <bits/stdc++.h> using namespace std; int main() { long long n; int x, m; vector<int> check(m + 5, 0); vector<long long> store(m + 5, 0); cin >> n >> x >> m; check[x] = 1; store[1] = x; long long next = x; long long ans = x; for (long long i = 2; i <= n; i++) { next = (next * next) % m;...
#include <bits/stdc++.h> using namespace std; int main() { long long n; int x, m; vector<int> check(200001, 0); vector<long long> store(200001, 0); cin >> n >> x >> m; check[x] = 1; store[1] = x; long long next = x; long long ans = x; for (long long i = 2; i <= n; i++) { next = (next * next) % ...
[["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]]
1
250
n, x, m = map(int,input().split()) lst = [0 for i in range(m)] lst2 = [x] i = 2 lst[x] = 1 c = 0 while True: if (i > n): break x = x**2%m if (lst[x] == 0): lst[x] = i lst2.append(lst2[i - 2] + x) i = i + 1 else: lst2.append(lst2[i - 2] + x) c = 1 b...
n, x, m = map(int,input().split()) lst = [0 for i in range(m)] lst2 = [x] i = 2 lst[x] = 1 c = 0 while True: if (i > n): break x = x**2%m if (lst[x] == 0): lst[x] = i lst2.append(lst2[i - 2] + x) i = i + 1 else: lst2.append(lst2[i - 2] + x) c = 1 b...
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
220
n,x,m = map(int, input().split()) be = x % m ans = be memo = [[0,0] for i in range(m)] am = [be] memo[be-1] = [1,0] #len-1 for i in range(n-1): be = be**2 % m if be == 0: break elif memo[be-1][0] == 1: kazu = memo[be-1][1] l = len(am) - kazu syou = (n-i) // l amari ...
n,x,m = map(int, input().split()) be = x % m ans = be memo = [[0,0] for i in range(m)] am = [be] memo[be-1] = [1,0] #len-1 for i in range(n-1): be = be**2 % m if be == 0: break elif memo[be-1][0] == 1: kazu = memo[be-1][1] l = len(am) - kazu syou = (n-i-1) // l amar...
[["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 612], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
230
#include <bits/stdc++.h> using namespace std; int main() { long long n, x, m, ans, loopans, ac, jdg; cin >> n >> x >> m; ans = x; ac = x; loopans = 0; jdg = 0; vector<long long> a(m, 0), loopcount(3, 0); for (long long i = 1; i < n; i++) { ac = ac * ac % m; if (a[ac] == 0) { a[ac] = i; ...
#include <bits/stdc++.h> using namespace std; int main() { long long n, x, m, ans, loopans, ac, jdg; cin >> n >> x >> m; ans = x; ac = x; loopans = 0; jdg = 0; vector<long long> a(m, 0), loopcount(3, 0); for (long long i = 1; i < n; i++) { ac = ac * ac % m; if (a[ac] == 0) { a[ac] = i; ...
[["-", 12, 23, 0, 16, 31, 23, 0, 2, 63, 40]]
1
310
/* Written by Kabir Kanha Arora @kabirkanha */ import java.util.*; public class Main { public static void main(String[] args) { // Input Scanner scanner = new Scanner(System.in); long n = scanner.nextLong(); long x = scanner.nextLong(); long m = scanner.nextLong(); HashMap<Long, L...
/* Written by Kabir Kanha Arora @kabirkanha */ import java.util.*; public class Main { public static void main(String[] args) { // Input Scanner scanner = new Scanner(System.in); long n = scanner.nextLong(); long x = scanner.nextLong(); long m = scanner.nextLong(); HashMap<Long, L...
[["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 24], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 25]]
3
430
N,X,M=map(int,input().split()) seen=[-2]*M seen[X] A=[X] i=1 while(i<N): T=A[-1]**2%M if seen[T]!=-2: Roop=i-seen[T] Left,Right=seen[T],i break A.append(T) seen[T]=i i+=1 if i==N: print(sum(A)+T) exit() Roopsum=0 for i in range(Left,Right): Roopsum+=A[i] Rest=...
N,X,M=map(int,input().split()) seen=[-2]*M seen[X] A=[X] i=1 while(i<N): T=A[-1]**2%M if seen[T]!=-2: Roop=i-seen[T] Left,Right=seen[T],i break A.append(T) seen[T]=i i+=1 if i==N: print(sum(A)) exit() Roopsum=0 for i in range(Left,Right): Roopsum+=A[i] Rest=N-...
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
180
#include <iostream> #include <map> #include <vector> using namespace std; long long N, X, M, ans; int main() { cin >> N >> X >> M; map<int, int> m; vector<long long> A(2); A[0] = 0LL; A[1] = X; for (int i = 1; i <= N; i++) { // cout<<"A"<<i<<"="<<A[i]<<endl; if (m[A[i]]) { // cout<<"used:...
#include <iostream> #include <map> #include <vector> using namespace std; long long N, X, M, ans; int main() { cin >> N >> X >> M; map<int, int> m; vector<long long> A(2); A[0] = 0LL; A[1] = X; for (int i = 1; i <= N; i++) { // cout<<"A"<<i<<"="<<A[i]<<endl; if (m[A[i]]) { // cout<<"used:...
[["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
1
294
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; #define inf 1e18 + 18 #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define mod 1000000007...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; #define inf 1e18 + 18 #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define mod 1000000007...
[["-", 15, 16, 12, 2, 3, 4, 0, 74, 51, 13], ["+", 15, 16, 12, 2, 3, 4, 0, 74, 51, 13], ["+", 64, 9, 0, 7, 8, 9, 0, 43, 39, 78]]
1
415
def resolve(): n, x, m = map(int, input().split()) a = [None] * m s = [x] a[x] = 0 ans = x for i in range(1, n): x = pow(x, 2, m) if a[x] is None: ans += x a[x] = i s.append(ans) else: past = a[x] d = i - past ...
def resolve(): n, x, m = map(int, input().split()) a = [None] * m s = [x] a[x] = 0 ans = x for i in range(1, n): x = pow(x, 2, m) if a[x] is None: ans += x a[x] = i s.append(ans) else: past = a[x] d = i - past ...
[["+", 31, 23, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 31, 23, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 12, 23, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 12, 23, 0, 657, 31, 23, 0, 657, 12, 612]]
5
169
x = int(input()) if x == 1: print(0) elif X == 0: print(1)
x = int(input()) if x == 1: print(0) elif x == 0: print(1) else: pass
[["-", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["+", 0, 57, 75, 76, 8, 196, 0, 674, 0, 675]]
5
26
#include <stdio.h> int main(void) { int x; scanf("%d", x); if (x == 0) printf("1"); else printf("0"); return 0; }
#include <stdio.h> int main(void) { int x; scanf("%d", &x); if (x == 0) printf("1"); else printf("0"); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
45
x = intZ(input()) print(0 if x else 1)
x = int(input()) print(0 if x else 1)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
16
N=int(input()) if N == 1: print(0) elif N==o: print(1)
N=int(input()) if N == 1: print(0) elif N==0: print(1)
[["-", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 0, 612]]
5
26
#include <stdio.h> int main(void) { int a; scanf("%d", &a); if (a == 0) printf("1\a"); else printf("0\a"); return 0; }
#include <stdio.h> int main(void) { int a; scanf("%d", &a); if (a == 0) printf("1\n"); else printf("0\n"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
48
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define STR 10 int main() { int x = 0; scanf("%d", &x); if (x == 1) { printf("1"); } else { printf("0"); } }
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define STR 10 int main() { int x = 0; scanf("%d", &x); if (x == 1) { printf("0"); } else { printf("1"); } }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
59
package main import "fmt" func main() { var a int fmt.Scan(a) if a == 1 { fmt.Println("0") } else if a == 0 { fmt.Println("1") } }
package main import "fmt" func main() { var a int fmt.Scan(&a) if a == 1 { fmt.Println("0") } else if a == 0 { fmt.Println("1") } }
[["+", 0, 1, 0, 2, 3, 4, 0, 91, 17, 67], ["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165]]
7
57
#include <stdio.h> int main(void) { int x, cnt1, cnt0; cnt0 = 0; cnt1 = 1; scanf("%d", &x); if (x == 0) printf("%d\n", cnt0); if (x == 1) printf("%d\n", cnt1); return 0; }
#include <stdio.h> int main(void) { int x, cnt1, cnt0; cnt0 = 0; cnt1 = 1; scanf("%d", &x); if (x == 0) printf("%d\n", cnt1); if (x == 1) printf("%d\n", cnt0); return 0; }
[["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 22]]
0
69
//コンパイラ最適化 #pragma GCC optimize("Ofast") //インクルードなど #include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { int x; cin >> x; if (x == 0) cout << x; else cout << x; }
//コンパイラ最適化 #pragma GCC optimize("Ofast") //インクルードなど #include <bits/stdc++.h> using namespace std; typedef long long ll; signed main() { int x; cin >> x; if (x == 0) cout << 1; else cout << 0; }
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 13], ["-", 0, 57, 75, 76, 0, 1, 0, 16, 12, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 12, 13]]
1
43
#include <iostream> using namespace std; int main() { int x; if (x == 0) { cout << 1; } else if (x == 1) { cout << 0; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1; } else if (x == 1) { cout << 0; } }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
40
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long add(long long a, long long b) { long long res = a + b; if (res >= mod) res -= mod; return res; } long long sub(long long a, long long b) { long long res = a - b + mod; if (res >= mod) res -= mod; return res; } long...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long add(long long a, long long b) { long long res = a + b; if (res >= mod) res -= mod; return res; } long long sub(long long a, long long b) { long long res = a - b + mod; if (res >= mod) res -= mod; return res; } long...
[["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
339
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x == 0) cout << "1"; else if (x == 1) cout << "2"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x == 0) cout << "1"; else if (x == 1) cout << "0"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
47
// God's Grace #include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utilit...
// God's Grace #include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utilit...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
1,082
#include <stdio.h> int main() { int x; scanf("%d", &x); if (x == 0) printf("1"); else printf("1"); }
#include <stdio.h> int main() { int x; scanf("%d", &x); if (x == 0) printf("1"); else printf("0"); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
42
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #incl...
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #incl...
[["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
130
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x = 0) { cout << "1" << endl; } else { cout << "0" << endl; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << "1" << endl; } else { cout << "0" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
46
#include <iostream> using namespace std; int main() { int x; if (x == 0) { cout << 1 << endl; } else { cout << 0 << endl; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 0) { cout << 1 << endl; } else { cout << 0 << endl; } }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
38
#include <iostream> using namespace std; int main() { int x; if (x == 1) { cout << 0; } else { cout << 1; } }
#include <iostream> using namespace std; int main() { int x; cin >> x; if (x == 1) { cout << 0; } else { cout << 1; } }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
34
#include <stdio.h> #include <stdlib.h> int main() { int x; scanf("%d", x); if (x == 0) printf("1"); if (x == 1) printf("0"); system("pause"); return 0; }
#include <stdio.h> #include <stdlib.h> int main() { int a; scanf("%d", &a); if (a == 0) printf("1"); if (a == 1) printf("0"); system("pause"); return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22]]
0
58
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main(void) { ll x; cin >> x; if (x == 1) cout << '1' << endl; else cout << '0' << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main(void) { ll x; cin >> x; if (x == 0) cout << '1' << endl; else cout << '0' << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
56
#include <bits/stdc++.h> using namespace std; int main() { int x; cout << 1 - x << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << 1 - x << endl; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
23
x = int(x) # OUTPUTS # Print 1 if input is equal to 0 if x == 0: print(1) exit() # Print 0 if input is equal to 1 if x == 1: print(0) exit()
x = input() x = int(x) # OUTPUTS # Print 1 if input is equal to 0 if x == 0: print(1) exit() # Print 0 if input is equal to 1 if x == 1: print(0) exit()
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]]
5
33
#include <bits/stdc++.h> // 2D vector decalre in c++ also memset to -1 // vector<vector<int>>f((m+1),(vector<int>(n+1,-1))); ////#include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; #define lli long long int #define endl '\n' #define boost ...
#include <bits/stdc++.h> // 2D vector decalre in c++ also memset to -1 // vector<vector<int>>f((m+1),(vector<int>(n+1,-1))); ////#include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; #define lli long long int #define endl '\n' #define boost ...
[["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
1,046