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
import java.io.PrintStream; import java.lang.reflect.Array; import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); PrintStream printStream = new PrintStream(System.out); new ProblemE().solve(scanner, printStream); } static class Ut...
import java.io.PrintStream; import java.lang.reflect.Array; import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); PrintStream printStream = new PrintStream(System.out); new ProblemE().solve(scanner, printStream); } static class Ut...
[["-", 51, 227, 497, 505, 0, 23, 0, 16, 12, 499], ["+", 51, 227, 497, 505, 0, 23, 0, 16, 12, 499]]
3
645
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vector<vector<T>>; #define eb emplace_back #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (n); i++) #def...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vector<vector<T>>; #define eb emplace_back #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (n); i++) #def...
[["+", 31, 16, 12, 23, 0, 16, 31, 16, 17, 109], ["+", 31, 16, 12, 23, 0, 16, 31, 16, 12, 22]]
1
795
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
511
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, s, n) for (ll i = (s); i < (ll)(n); i++) #define all(x) (x).begin(), (x).end() #define in(x, l, r) (ll)(l) <= (x) && (x) < (ll)(r) const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MA...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, s, n) for (ll i = (s); i < (ll)(n); i++) #define all(x) (x).begin(), (x).end() #define in(x, l, r) (ll)(l) <= (x) && (x) < (ll)(r) const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MA...
[["+", 8, 9, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 14, 8, 9, 0, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22]]
1
398
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; i++) #define rep2(i, a, b) for (ll i = (a); i < (b); ++i) template <class T> inline void chmin(T &a, T b) { if (a > b) a = b; } template <class T> inline void chmax(T &a, T b)...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; i++) #define rep2(i, a, b) for (ll i = (a); i < (b); ++i) template <class T> inline void chmin(T &a, T b) { if (a > b) a = b; } template <class T> inline void chmax(T &a, T b)...
[["-", 8, 9, 0, 9, 0, 1, 0, 16, 17, 109], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 17, 132]]
1
662
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPP(i, n) for (int i = 1; i <= n; i++) #define ALL(obj) (obj).begin(), (obj).end() long long INF = (long long)1E17; #define i_7 (long long)(1E9 + 7) //#define i_7 998'244'353 long mod(long a) { long long c = a % i_7; if (c >= 0) ret...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPP(i, n) for (int i = 1; i <= n; i++) #define ALL(obj) (obj).begin(), (obj).end() long long INF = (long long)1E17; #define i_7 (long long)(1E9 + 7) //#define i_7 998'244'353 long mod(long a) { long long c = a % i_7; if (c >= 0) ret...
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
542
n,m=map(int,input().split()) a = 1 Mod=1e9+7 d = [1]*(n+1) for i in range(n): d[i+1]=((m-n+i)*d[i]+i*d[i-1])%Mod a=a*(m-i)%Mod print(int(a*d[n]%Mod))
n,m=map(int,input().split()) a = 1 Mod=10**9+7 d = [1]*(n+1) for i in range(n): d[i+1]=((m-n+i)*d[i]+i*d[i-1])%Mod a=a*(m-i)%Mod print(a*d[n]%Mod)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 531], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 578], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
100
#include <bits/stdc++.h> using namespace std; const long long N = 500005; const long long mod = 1000000007; long long fact[N]; void set_fact() { fact[0] = 1; for (long long i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % mod; } long long power(long long x, long long y) { long long ans = 1; while (y > 0)...
#include <bits/stdc++.h> using namespace std; const long long N = 500005; const long long mod = 1000000007; long long fact[N]; void set_fact() { fact[0] = 1; for (long long i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % mod; } long long power(long long x, long long y) { long long ans = 1; while (y > 0)...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
357
// E - NEQ #include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; #define MOD 1000000007 vl fac{1, 1}; // 階乗 n! vl inv{0, 1}; // 逆元 1/n vl finv{1, 1}; // 逆元の階乗 (n^-1)! = (1/n)! void finv_init(int n) { int p = MOD; for (int i = 2; i <= n; ++i) { fac.push_back(fac.back() * i...
// E - NEQ #include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; #define MOD 1000000007 vl fac{1, 1}; // 階乗 n! vl inv{0, 1}; // 逆元 1/n vl finv{1, 1}; // 逆元の階乗 (n^-1)! = (1/n)! void finv_init(int n) { int p = MOD; for (int i = 2; i <= n; ++i) { fac.push_back(fac.back() * i...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
329
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 1e5 + 5, MOD = 1e9 + 7; struct mi { ll v; explicit operator ll() const { return v; } mi() { v = 0; } mi(ll _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD; if (v < 0) v += MOD; } friend bool operator==(c...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 5e5 + 5, MOD = 1e9 + 7; struct mi { ll v; explicit operator ll() const { return v; } mi() { v = 0; } mi(ll _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD; if (v < 0) v += MOD; } friend bool operator==(c...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
876
#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> ...
[["-", 31, 23, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35]]
1
539
#include <cmath> #include <iostream> #include <vector> using namespace std; // 素数 p で割ったあまりに関する構造体 (特に p = 1000000007 とすることが多い) template <int MOD> struct Fp { long long val; constexpr Fp(long long v = 0) noexcept : val(v % MOD) { if (val < 0) v += MOD; } constexpr int getmod() { return MOD; } cons...
#include <cmath> #include <iostream> #include <vector> using namespace std; // 素数 p で割ったあまりに関する構造体 (特に p = 1000000007 とすることが多い) template <int MOD> struct Fp { long long val; constexpr Fp(long long v = 0) noexcept : val(v % MOD) { if (val < 0) v += MOD; } constexpr int getmod() { return MOD; } cons...
[["-", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 17, 85], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 90], ["-", 12, 23, 0, 16, 12, 2, 3, 4, 0, 25]]
1
925
eval'N,M='+`tr ' ' ,` a=1 N.times{|i|a,$.=(M-i)*((M-N+i)*a+i*$.*=M-i+1)%(10**9+7),a} p a
eval'N,M='+`tr ' ' ,` a=1 N.times{|i|a,$.=(M-i)*((M-N+i)*a+i*$.*(M-i+1))%(10**9+7),a} p a
[["-", 12, 739, 0, 738, 12, 738, 12, 755, 17, 108], ["+", 31, 738, 12, 739, 0, 738, 12, 738, 17, 48], ["+", 12, 739, 0, 738, 12, 738, 12, 739, 0, 24], ["+", 12, 739, 0, 738, 12, 738, 12, 739, 0, 25]]
4
62
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n; ll m; const ll mod = 1e9 + 7; const ll maxn = 500005; ll inv[maxn + 3]; ll fac[maxn + 3]; ll qpow(ll x, ll n) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } inline...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n; ll m; const ll mod = 1e9 + 7; const ll maxn = 500005; ll inv[maxn + 3]; ll fac[maxn + 3]; ll qpow(ll x, ll n) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } inline...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22]]
1
405
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define $(x) (int)((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define endl '\n' #define x first #define y second #define int long long #define double long double #define pii pair<int, int> #define pb...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define $(x) (int)((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define endl '\n' #define x first #define y second #define int long long #define double long double #define pii pair<int, int> #define pb...
[["-", 31, 23, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 22]]
1
668
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } #define rep(i, n) for (int i ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } #define rep(i, n) for (int i ...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
603
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<vl> vvl; typedef vector<vi> vvi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef vector<pii> vpii; typedef vector<vpll> vvpl...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<vl> vvl; typedef vector<vi> vvi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef vector<pii> vpii; typedef vector<vpll> vvpl...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
536
//雪花飄飄北風嘯嘯 //天地一片蒼茫 #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; #define ll long long #define ii pair<ll, ll> #define iii pair<ii, ll> #define fi first #define se se...
//雪花飄飄北風嘯嘯 //天地一片蒼茫 #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; #define ll long long #define ii pair<ll, ll> #define iii pair<ii, ll> #define fi first #define se se...
[["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]]
1
524
#include <bits/stdc++.h> #include <cassert> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; struct Edge { int to; int weight; Edge(int t, int w) : to(t), weight(w) {} }; using Graph = vector<vector<Edge>>; // using Graph = vector<vector<int>>; ...
#include <bits/stdc++.h> #include <cassert> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; struct Edge { int to; int weight; Edge(int t, int w) : to(t), weight(w) {} }; using Graph = vector<vector<Edge>>; // using Graph = vector<vector<int>>; ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67], ["+...
1
774
n, m = map(int, input().split()) a,M,d=1,10**9+7,[1]*(n+1) for i in range(n): d[i+1]=((m-n+1)*d[i]+i*d[i-1])%M a=a*(m-1)%M print(a*d[-1]%M)
n,m=map(int,input().split()) a,M,d=1,10**9+7,[1]*(n+1) for i in range(n): d[i+1]=((m-n+i)*d[i]+i*d[i-1])%M a=a*(m-i)%M print(a*d[-1]%M)
[["-", 0, 657, 31, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 657, 31, 657, 31, 23, 0, 657, 12, 22], ["-", 12, 657, 31, 657, 12, 23, 0, 657, 12, 612], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 12, 22]]
5
102
#include <algorithm> #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 <utility> #include <vector> // a^n mod を計算する long long modpow(long long a, long long n...
#include <algorithm> #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 <utility> #include <vector> // a^n mod を計算する long long modpow(long long a, long long n...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 8, 9, 0, 57, 75, 76, 0, 57, 0, 121]]
1
633
MOD = 10**9 + 7 MAX = 5*10**5 + 1 fact = [0 for _ in range(MAX)] factinv = [0 for _ in range(MAX)] fact[0] = 1 for k in range(1, MAX): fact[k] = fact[k - 1]*k fact[k] %= MOD factinv[MAX - 1] = pow(fact[MAX - 1], MOD - 2, MOD) for k in range(MAX - 1, 0, -1): factinv[k - 1] = factinv[k]*k factinv[k - 1...
MOD = 10**9 + 7 MAX = 5*10**5 + 1 fact = [0 for _ in range(MAX)] factinv = [0 for _ in range(MAX)] fact[0] = 1 for k in range(1, MAX): fact[k] = fact[k - 1]*k fact[k] %= MOD factinv[MAX - 1] = pow(fact[MAX - 1], MOD - 2, MOD) for k in range(MAX - 1, 0, -1): factinv[k - 1] = factinv[k]*k factinv[k - 1...
[["+", 0, 7, 8, 196, 0, 57, 15, 681, 0, 372]]
5
273
#include <bits/stdc++.h> using namespace std; #ifndef aa #define trace(...) #define endl '\n' #endif #define pb push_back #define ub upper_bound #define lb lower_bound #define fi first #define se second #define int long long typedef long long ll; typedef long double ld; #define double long double #define pii pair<int...
#include <bits/stdc++.h> using namespace std; #ifndef aa #define trace(...) #define endl '\n' #endif #define pb push_back #define ub upper_bound #define lb lower_bound #define fi first #define se second #define int long long typedef long long ll; typedef long double ld; #define double long double #define pii pair<int...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
672
from functools import reduce n, m = map(int, input().split()) mod = 10 ** 9 + 7 ans = 0 c = 1 p1 = 1 p2 = reduce(lambda ac, v: ac * v % mod, range(m, m - n, -1), 1) for i in range(n + 1): if i > 0: c = (c * (n - i + 1) * pow(i, mod - 2, mod)) % mod p1 = (p1 * (n - i + 1)) % mod p2 = (p2 * ...
from functools import reduce n, m = map(int, input().split()) mod = 10 ** 9 + 7 ans = 0 c = 1 p1 = 1 p2 = reduce(lambda ac, v: ac * v % mod, range(m, m - n, -1), 1) for i in range(n + 1): if i > 0: c = (c * (n - i + 1) * pow(i, mod - 2, mod)) % mod p1 = (p1 * (m - i + 1)) % mod p2 = (p2 * ...
[["-", 0, 657, 12, 23, 0, 657, 31, 657, 31, 22], ["+", 0, 657, 12, 23, 0, 657, 31, 657, 31, 22], ["-", 12, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 31, 22]]
5
176
#pragma GCC optimize("O2") #include <bits/stdc++.h> #ifdef DEBUG #include "debug.hpp" #endif using namespace std; #define all(c) (c).begin(), (c).end() #define traverse(c, it) for (auto it = (c).begin(); it != (c).end(); it++) #define rep(i, N) for (int i = 0; i < (N); i++) #define rep1(i, N) for (int i = 1; i <= (N...
#pragma GCC optimize("O2") #include <bits/stdc++.h> #ifdef DEBUG #include "debug.hpp" #endif using namespace std; #define all(c) (c).begin(), (c).end() #define traverse(c, it) for (auto it = (c).begin(); it != (c).end(); it++) #define rep(i, N) for (int i = 0; i < (N); i++) #define rep1(i, N) for (int i = 1; i <= (N...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
515
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 long long int gcdExtended(long long int a, long long int b, long long int *x, long long int *y); long long int modInverse(long long int a) { long long int x, y; long long int g = gcdExtended(a, mod, &x, &y); long long...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 long long int gcdExtended(long long int a, long long int b, long long int *x, long long int *y); long long int modInverse(long long int a) { long long int x, y; long long int g = gcdExtended(a, mod, &x, &y); long long...
[["+", 12, 16, 31, 23, 0, 16, 12, 74, 0, 24], ["+", 0, 16, 12, 74, 39, 77, 39, 86, 0, 96], ["+", 0, 16, 12, 74, 39, 77, 39, 86, 39, 40], ["+", 12, 16, 31, 23, 0, 16, 12, 74, 0, 25]]
1
437
#ifdef MY_LOCAL #define MY_NAMESPACE(ns) namespace ns { #define MY_NAMESPACE_ } #define MY_DEBUG(s) s #else #define MY_NAMESPACE(ns) #define MY_NAMESPACE_ #define MY_DEBUG(s) #endif #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <...
#ifdef MY_LOCAL #define MY_NAMESPACE(ns) namespace ns { #define MY_NAMESPACE_ } #define MY_DEBUG(s) s #else #define MY_NAMESPACE(ns) #define MY_NAMESPACE_ #define MY_DEBUG(s) #endif #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 132], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
572
#atcoder template def main(): import sys imput = sys.stdin.readline #文字列入力の時は上記はerrorとなる。 #ここにコード #input n, m = map(int, input().split()) #output mod = pow(10, 9) + 7 n_ = 4 * pow(10, 5) + 5 fun = [1] * (n_+1) for i in range(1, n_+1): fun[i] = fun[i-1] * i % mod ...
#atcoder template def main(): import sys imput = sys.stdin.readline #文字列入力の時は上記はerrorとなる。 #ここにコード #input n, m = map(int, input().split()) #output mod = pow(10, 9) + 7 n_ = 5 * pow(10, 5) + 5 fun = [1] * (n_+1) for i in range(1, n_+1): fun[i] = fun[i-1] * i % mod ...
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 31, 612]]
5
323
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define rep(i, a, b) for (ll i = a; i < b; ++i) #define IOS \ ios::sync_with_stdio(0); ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define rep(i, a, b) for (ll i = a; i < b; ++i) #define IOS \ ios::sync_with_stdio(0); ...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22]]
1
446
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pi pair<int, int> #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back #define ff first #define ss second #define end...
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pi pair<int, int> #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back #define ff first #define ss second #define end...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
527
#include <bits/stdc++.h> #define MOD 1000000007 typedef long long ll; using namespace std; int n, m, fact[500001], invfact[500001], ans; int add(int a, int b) { return (a + b) % MOD; } int mul(int a, int b) { return (ll(a) * ll(b)) % MOD; } int exp(int a, int b = MOD - 2) { int ret = 1; while (b != 0) { if...
#include <bits/stdc++.h> #define MOD 1000000007 typedef long long ll; using namespace std; int n, m, fact[500001], invfact[500001], ans; int add(int a, int b) { return (a + b) % MOD; } int mul(int a, int b) { return (ll(a) * ll(b)) % MOD; } int exp(int a, int b = MOD - 2) { int ret = 1; while (b != 0) { if...
[["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25]]
1
337
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define all(x) (x).beg...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define all(x) (x).beg...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
488
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> v; typedef vector<vector<ll>> vv; #define MOD 1000000007 #defi...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> v; typedef vector<vector<ll>> vv; #define MOD 1000000007 #defi...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
589
import sys input=sys.stdin.readline sys.setrecursionlimit(10 ** 8) from itertools import accumulate from itertools import permutations from itertools import combinations from collections import defaultdict from collections import Counter import fractions import math from collections import deque from bisect import bise...
import sys input=sys.stdin.readline sys.setrecursionlimit(10 ** 8) from itertools import accumulate from itertools import permutations from itertools import combinations from collections import defaultdict from collections import Counter import fractions import math from collections import deque from bisect import bise...
[["-", 36, 36, 36, 36, 0, 656, 0, 14, 141, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 14, 141, 22]]
5
463
fac=[1]*505050 inv=[1]*505050 finv=[1]*505050 mod=1000000007 for i in range(1,500010): fac[i]=fac[i-1]*i%mod inv[i]=-inv[mod%i]*(mod//i)%mod finv[i]=finv[i-1]*inv[i]%mod def C(n,r): if n<0 or r<0 or n<r: return 0 return fac[n]*inv[n-r]*inv[r]%mod N,M=map(int,input().split()) ans=0 for i in range(N+1): ans...
fac=[1]*505050 inv=[1]*505050 finv=[1]*505050 mod=1000000007 for i in range(2,500010): fac[i]=fac[i-1]*i%mod inv[i]=-inv[mod%i]*(mod//i)%mod finv[i]=finv[i-1]*inv[i]%mod def C(n,r): if n<0 or r<0 or n<r: return 0 return fac[n]*finv[n-r]*finv[r]%mod N,M=map(int,input().split()) ans=0 for i in range(N+1): a...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 657, 31, 657, 31, 657, 12, 206, 51, 22], ["+", 0, 657, 31, 657, 31, 657, 12, 206, 51, 22], ["-", 0, 37, 0, 657, 31, 657, 12, 206, 51, 22], ["+", 0, 37, 0, 657, 31, 657, 12, 206, 51, 22]]
5
219
SIZE=4*10**5+1; MOD=10**9+7 #998244353 #ここを変更する SIZE += 1 inv = [0]*SIZE # inv[j] = j^{-1} mod MOD fac = [0]*SIZE # fac[j] = j! mod MOD finv = [0]*SIZE # finv[j] = (j!)^{-1} mod MOD inv[1] = 1 fac[0] = fac[1] = 1 finv[0] = finv[1] = 1 for i in range(2,SIZE): inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD fac[i] = f...
SIZE=5*10**5+1; MOD=10**9+7 #998244353 #ここを変更する SIZE += 1 inv = [0]*SIZE # inv[j] = j^{-1} mod MOD fac = [0]*SIZE # fac[j] = j! mod MOD finv = [0]*SIZE # finv[j] = (j!)^{-1} mod MOD inv[1] = 1 fac[0] = fac[1] = 1 finv[0] = finv[1] = 1 for i in range(2,SIZE): inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD fac[i] = f...
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 31, 612]]
5
301
#include <bits/stdc++.h> #define int long long using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) typedef pair<int, int> pii; const int INF = 1l << 60; constexpr int mod = 1000000007; #define ll long long template <ll M = mod> class ModInt { public: ModInt(ll data = 0) : data((data % M + M) % M) ...
#include <bits/stdc++.h> #define int long long using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) typedef pair<int, int> pii; const int INF = 1l << 60; constexpr int mod = 1000000007; #define ll long long template <ll M = mod> class ModInt { public: ModInt(ll data = 0) : data((data % M + M) % M) ...
[["-", 0, 1, 0, 11, 12, 41, 15, 16, 17, 47], ["+", 0, 1, 0, 11, 12, 41, 15, 16, 17, 20]]
1
1,401
MOD = 10 ** 9 + 7 N,M = map(int,input().split()) ans1 = 1 for i in range(N): ans1 *= M - i ans1 %= MOD ans2 = [1,M-N] for i in range(2,N+1): ans2.append((ans2[-2] * (N-1) + ans2[-1] * (M-1))% MOD) print(ans1 * ans2[N] % MOD)
MOD = 10 ** 9 + 7 N,M = map(int,input().split()) ans1 = 1 for i in range(N): ans1 *= M - i ans1 %= MOD ans2 = [1,M-N] for i in range(2,N+1): ans2.append((ans2[-2] * (i -1) + ans2[-1] * (M - N + i - 1))% MOD) print(ans1 * ans2[N] % MOD)
[["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 12, 23, 0, 657, 31, 657, 31, 657, 17, 33], ["+", 12, 23, 0, 657, 31, 657, 31, 657, 12, 22], ["+", 12, 657, 12, 23, 0, 657, 31, 657, 17, 72], ["+", 12, 657, 12, 23, 0, 657, 31, 657, 12, 22]]
5
106
#include <bits/stdc++.h> #ifndef M_PI #define M_PI 3.14159265358979 #endif #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) using namespace std; typedef long long ll; typedef vector<long long> vll; typedef pair<long long, long long> pll; const ll INF = 1e15; cons...
#include <bits/stdc++.h> #ifndef M_PI #define M_PI 3.14159265358979 #endif #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) using namespace std; typedef long long ll; typedef vector<long long> vll; typedef pair<long long, long long> pll; const ll INF = 1e15; cons...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
438
#pragma region RegionDefs #include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, l, r) for (int i = (l), i##_len = (r); i < i##_len; ++i) #define all(x) begin(x), end(x) using namespace std; typedef long long ll; const ll INF = 1e9; template <class T = ll> using V = ...
#pragma region RegionDefs #include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, l, r) for (int i = (l), i##_len = (r); i < i##_len; ++i) #define all(x) begin(x), end(x) using namespace std; typedef long long ll; const ll INF = 1e9; template <class T = ll> using V = ...
[["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72]]
1
652
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 7, N = 4e5 + 9; int fac[N], ifac[N]; int pw(int a, int t = mod - 2) { int x = 1; while (t > 0) { if (t & 1) x = x * a % mod; a = a * a % mod, t >>= 1; } return x; } int C(int n, int r) { if (r < 0 or r > ...
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 7, N = 2e6 + 9; int fac[N], ifac[N]; int pw(int a, int t = mod - 2) { int x = 1; while (t > 0) { if (t & 1) x = x * a % mod; a = a * a % mod, t >>= 1; } return x; } int C(int n, int r) { if (r < 0 or r > ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 354], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
338
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7; inline ll qpow(ll a, ll n) { ll res = 1; while (n) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int n, m; ll ans, f[500005] = {1}, inv[500005] = {1}; int main() { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7; inline ll qpow(ll a, ll n) { ll res = 1; while (n) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int n, m; ll ans, f[500005] = {1}, inv[500005] = {1}; int main() { ...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
289
#include <bits/stdc++.h> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
#include <bits/stdc++.h> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
503
#include <algorithm> #include <array> #include <cassert> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <tuple> #include <un...
#include <algorithm> #include <array> #include <cassert> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <tuple> #include <un...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72]]
1
440
#include <bits/stdc++.h> using namespace std; #define int long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define MOD 1000000007 template <...
#include <bits/stdc++.h> using namespace std; #define int long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define MOD 1000000007 template <...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
559
#include <bits/stdc++.h> using namespace std; template <int mod = (int)(1e9 + 7)> struct ModInt { int x; ModInt() : x(0) {} ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {} ModInt &operator+=(const ModInt &p) { if ((x += p.x) >= mod) x -= mod; return *this; } ModInt &oper...
#include <bits/stdc++.h> using namespace std; template <int mod = (int)(1e9 + 7)> struct ModInt { int x; ModInt() : x(0) {} ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {} ModInt &operator+=(const ModInt &p) { if ((x += p.x) >= mod) x -= mod; return *this; } ModInt &oper...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 17, 110], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 107]]
1
1,016
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) namespace IO { #define gc getchar() template <typename T> inline void read(T &x) { x = 0; bool f = 1; char ch; for (ch = g...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i) #define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i) namespace IO { #define gc getchar() template <typename T> inline void read(T &x) { x = 0; bool f = 1; char ch; for (ch = g...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
422
#include <bits/stdc++.h> //Ithea Myse Valgulious namespace chtholly { typedef long long ll; #define re0 register int #define rel register ll #define rec register char #define gc getchar //#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?-1:*p1++) #define pc putchar #define p32 pc(' ') #define pl puts...
#include <bits/stdc++.h> //Ithea Myse Valgulious namespace chtholly { typedef long long ll; #define re0 register int #define rel register ll #define rec register char #define gc getchar //#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?-1:*p1++) #define pc putchar #define p32 pc(' ') #define pl puts...
[["-", 0, 2, 3, 4, 0, 41, 15, 91, 28, 22], ["+", 0, 2, 3, 4, 0, 41, 15, 91, 28, 22]]
1
594
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; template <class T> using V = vector<T>; #define fi first #define se second #define all(v) (v).begin(), (v).end() const ll inf = (1e18); const ll mod = 998244353; // const ll mod=1000000007; const vecto...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; template <class T> using V = vector<T>; #define fi first #define se second #define all(v) (v).begin(), (v).end() const ll inf = (1e18); const ll mod = 998244353; // const ll mod=1000000007; const vecto...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79]]
1
559
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; int main() { cin.tie(0); ios::sync_with_stdio(false); Int n; cin >> n; vector<Int> a(n); for (auto &i : a) cin >> i; Int k = 0; for (size_t i = 2; i < a.size(); ++i) k ^= a[i]; Int l = a[0] + a[1]; if (l - k < 0 || (l -...
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; int main() { cin.tie(0); ios::sync_with_stdio(false); Int n; cin >> n; vector<Int> a(n); for (auto &i : a) cin >> i; Int k = 0; for (size_t i = 2; i < a.size(); ++i) k ^= a[i]; Int l = a[0] + a[1]; if (l - k < 0 || (l -...
[["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25]]
1
258
def main(): import sys def input(): return sys.stdin.readline().rstrip() n = int(input()) a = list(map(int, input().split())) x = 0 for i in range(2, n): x ^= a[i] d = a[0]+a[1]-x if d%2 == 1 or d < 0: print(-1) return d >>= 1 if d&x != 0 or d > a[0]: ...
def main(): import sys def input(): return sys.stdin.readline().rstrip() n = int(input()) a = list(map(int, input().split())) x = 0 for i in range(2, n): x ^= a[i] d = a[0]+a[1]-x if d%2 == 1 or d < 0: print(-1) return d >>= 1 if d&x != 0 or d > a[0]: ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 24], ["+", 0, 57, 15, 666, 0, 657, 12, 23, 0, 25]]
5
208
#include <bits/stdc++.h> using namespace std; #define LL long long LL A, B; int main() { int N; scanf("%d", &N); scanf("%lld%lld", &A, &B); LL p = 0; for (int i = 3; i <= N; i++) { LL x; scanf("%lld", &x); p = p ^ x; } LL s = A + B; if ((s - p) & 1 || s - p < 0) { puts("-1"); return ...
#include <bits/stdc++.h> using namespace std; #define LL long long LL A, B; int main() { int N; scanf("%d", &N); scanf("%lld%lld", &A, &B); LL p = 0; for (int i = 3; i <= N; i++) { LL x; scanf("%lld", &x); p = p ^ x; } LL s = A + B; if ((s - p) & 1 || s - p < 0) { puts("-1"); return ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47]]
1
301
N = int(input()) A = list(map(int, input().split())) XOR = 0 for el in A[2:]: XOR ^= el if (A[0] + A[1] - XOR) % 2 != 0: print(-1) exit(0) AND = (A[0] + A[1] - XOR) // 2 if XOR & AND != 0: print(-1) exit(0) ok = False u = 0 v = 0 bits = list() for bit in range(60, -1, -1): if XOR >> bit & 1...
N = int(input()) A = list(map(int, input().split())) XOR = 0 for el in A[2:]: XOR ^= el if (A[0] + A[1] - XOR) % 2 != 0: print(-1) exit(0) AND = (A[0] + A[1] - XOR) // 2 if XOR & AND != 0: print(-1) exit(0) ok = False u = 0 v = 0 bits = list() for bit in range(60, -1, -1): if XOR >> bit & 1...
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
231
n = int(input()) a = list(map(int,input().split())) x = 0 for i in range(2,n): x ^= a[i] s = a[0]+a[1] if s < x or (s-x) % 2 == 1: print(-1) exit() d = (s-x)//2 if d & x != 0 or d >= a[0]: print(-1) exit() i = 50 ans = d while i >= 0: if x >> i & 1: if (1 << i) + ans < a[0]: ...
n = int(input()) a = list(map(int,input().split())) x = 0 for i in range(2,n): x ^= a[i] s = a[0]+a[1] if s < x or (s-x) % 2 == 1: print(-1) exit() d = (s-x)//2 if d & x != 0 or d > a[0]: print(-1) exit() i = 50 ans = d while i >= 0: if x >> i & 1: if (1 << i) + ans <= a[0]: ...
[["-", 0, 656, 0, 57, 15, 679, 12, 666, 667, 20], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 47], ["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 19]]
5
171
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vc = vector<char>; using vvc = vector<vc>; using pll = pair<ll, ll>; using vpll = vector<pll>; const ll INF = 1LL << 60; const ll MOD = 1e9 + 7; #define rep(i, n) for (ll i = 0; i < (n); i++) temp...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vc = vector<char>; using vvc = vector<vc>; using pll = pair<ll, ll>; using vpll = vector<pll>; const ll INF = 1LL << 60; const ll MOD = 1e9 + 7; #define rep(i, n) for (ll i = 0; i < (n); i++) temp...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
379
// ----------------------------------- // author : MatsuTaku // country : Japan // created : 06/27/20 20:37:14 // ----------------------------------- #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector<...
// ----------------------------------- // author : MatsuTaku // country : Japan // created : 06/27/20 20:37:14 // ----------------------------------- #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector<...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 354], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 2, 63, 22]]
1
267
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <stack> using namespace std; int main(void) { int i, j; long long a, b, c, d; long long ll; int n; c = 0; scanf("%lld", &n); scanf("%lld", &a); scanf("%lld", &b); for (i = 2; i < n; i++) { scanf("%lld", &ll); ...
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <stack> using namespace std; int main(void) { int i, j; long long a, b, c, d; long long ll; int n; c = 0; scanf("%lld", &n); scanf("%lld", &a); scanf("%lld", &b); for (i = 2; i < n; i++) { scanf("%lld", &ll); ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85]]
1
304
#include <bits/stdc++.h> using namespace std; #define int long long const int MAX = 510000; const int MOD = 1000000007; // int fac[MAX], finv[MAX], inv[MAX]; signed main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int t = 0; for (int i = 2; i < n; i++) t ^= a[i]; int s...
#include <bits/stdc++.h> using namespace std; #define int long long const int MAX = 510000; const int MOD = 1000000007; // int fac[MAX], finv[MAX], inv[MAX]; signed main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int t = 0; for (int i = 2; i < n; i++) t ^= a[i]; int s...
[["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25]]
1
273
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
[["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 140], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 72], ["-", 0, 9, 0, 57, 64, 1, 0, 11, 17, 130], ["+", 0, 9, 0, 57, 64, 1, 0, 11, 17, 107]]
1
394
#include <iostream> using namespace std; using ll = long long; int main() { int n; cin >> n; ll x, y, Xor = 0; cin >> x >> y; for (int i = 0; i < n - 2; i++) { ll z; cin >> z; Xor ^= z; } if (x + y < Xor) { cout << -1 << endl; return 0; } ll And = x + y - Xor; if (And % 2) { ...
#include <iostream> using namespace std; using ll = long long; int main() { int n; cin >> n; ll x, y, Xor = 0; cin >> x >> y; for (int i = 0; i < n - 2; i++) { ll z; cin >> z; Xor ^= z; } if (x + y < Xor) { cout << -1 << endl; return 0; } ll And = x + y - Xor; if (And % 2) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47],...
1
203
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(0), cin.tie(0); int n; cin >> n; int a[n], x = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (i > 1) x ^= a[i]; } int sum = a[0] + a[1]; if ((sum - x) % 2) { cout << -1; re...
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(0), cin.tie(0); int n; cin >> n; int a[n], x = 0; for (int i = 0; i < n; i++) { cin >> a[i]; if (i > 1) x ^= a[i]; } int sum = a[0] + a[1]; if ((sum - x) % 2) { cout << -1; re...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 354], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 67], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]]
1
223
#include <bits/stdc++.h> #define int long long #define p pair<int, int> #define endl '\n' const int INF = 1000000000000000001; const long double E = 0.00000001; using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; vector<int> a(n); for (...
#include <bits/stdc++.h> #define int long long #define p pair<int, int> #define endl '\n' const int INF = 1000000000000000001; const long double E = 0.00000001; using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; vector<int> a(n); for (...
[["-", 51, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 31, 13]]
1
369
#include <bits/stdc++.h> #define endl "\n" using namespace std; typedef long long ll; typedef vector<ll> vl; typedef pair<ll, ll> PP; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define rrep(i, n) for (ll i = n - 1; i > -1; i--) #define all(v) v.begin(), v.end() #define pb push_back #define fi first #define se sec...
#include <bits/stdc++.h> #define endl "\n" using namespace std; typedef long long ll; typedef vector<ll> vl; typedef pair<ll, ll> PP; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define rrep(i, n) for (ll i = n - 1; i > -1; i--) #define all(v) v.begin(), v.end() #define pb push_back #define fi first #define se sec...
[["-", 15, 339, 51, 16, 31, 23, 0, 16, 31, 13], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 31, 13], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 31, 13], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13]]
1
455
#include <bits/stdc++.h> using namespace std; int const nax = 3e5 + 10; using ll = long long; int n; ll a[nax]; ll dp[65][2]; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%lld", a + i); } ll tar = 0; for (int i = 3; i <= n; ++i) { tar ^= a[i]; } ll x = a[1], y = a[2];...
#include <bits/stdc++.h> using namespace std; int const nax = 3e5 + 10; using ll = long long; int n; ll a[nax]; ll dp[65][2]; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%lld", a + i); } ll tar = 0; for (int i = 3; i <= n; ++i) { tar ^= a[i]; } ll x = a[1], y = a[2];...
[["+", 51, 16, 31, 16, 31, 16, 31, 16, 17, 47], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 98], ["+", 51, 16, 31, 16, 31, 16, 12, 16, 31, 22]]
1
734
//#pragma GCC optimize ("O3","unroll-loops") #include <cassert> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <algorithm> #include <cmath> #include <functional> #include <numeric> #include <bitset> #include <deque> #include <map> #include <queue> #include <set> #include <stack> ...
//#pragma GCC optimize ("O3","unroll-loops") #include <cassert> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <algorithm> #include <cmath> #include <functional> #include <numeric> #include <bitset> #include <deque> #include <map> #include <queue> #include <set> #include <stack> ...
[["+", 12, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
2,063
#include <bits/stdc++.h> using namespace std; #define Sz(a) ((int)(a).size()) const int maxn = 200009; const int MOD = 1e9 + 7; int main() { #ifdef LOCAL freopen("a.in", "r", stdin); #endif ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0); int n; cin >> n; vector<int64_t> A(n); for (int i = 0; i < ...
#include <bits/stdc++.h> using namespace std; #define Sz(a) ((int)(a).size()) const int maxn = 200009; const int MOD = 1e9 + 7; int main() { #ifdef LOCAL freopen("a.in", "r", stdin); #endif ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0); int n; cin >> n; vector<int64_t> A(n); for (int i = 0; i < ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
322
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
360
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using u64 = unsigned long long; using namespace std; template <class T> constexp...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using u64 = unsigned long long; using namespace std; template <class T> constexp...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
508
#include <bits/stdc++.h> #ifdef LOCAL_DEBUG #define DEBUG 1 #define CERR \ if (DEBUG) \ cerr #define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define pr(...) ...
#include <bits/stdc++.h> #ifdef LOCAL_DEBUG #define DEBUG 1 #define CERR \ if (DEBUG) \ cerr #define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME #define pr(...) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
963
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <s...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <s...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
394
/*====Corycle====*/ #include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> #define ll long long using namespace std; const int inf = 0x3f3f...
/*====Corycle====*/ #include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> #define ll long long using namespace std; const int inf = 0x3f3f...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
431
#include <bits/stdc++.h> #define FASTIO \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define LL long long int using nam...
#include <bits/stdc++.h> #define FASTIO \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define LL long long int using nam...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
398
#include <bits/stdc++.h> using namespace std; #define int long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } signed main() { int n; cin >> ...
#include <bits/stdc++.h> using namespace std; #define int long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } signed main() { int n; cin >> ...
[["-", 0, 43, 49, 50, 51, 69, 341, 342, 0, 13], ["+", 0, 43, 49, 50, 51, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 16, 31, 23, 0, 25]]
1
367
N = int(input()) A = [int(a) for a in input().split()] t = 0 for a in A[2:]: t ^= a s = sum(A[:2]) if s < t or (s ^ t) & 1: print(-1) exit() u = (s - t) // 2 a = A[0] n = 0 for i in range(40)[::-1]: b, c = (t >> i) & 1, (u >> i) & 1 if b == c == 1: print(-1) exit() if b == 0 an...
N = int(input()) A = [int(a) for a in input().split()] t = 0 for a in A[2:]: t ^= a s = sum(A[:2]) if s < t or (s ^ t) & 1: print(-1) exit() u = (s - t) // 2 a = A[0] n = 0 for i in range(40)[::-1]: b, c = (t >> i) & 1, (u >> i) & 1 if b == c == 1: print(-1) exit() if b == 0 and...
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
228
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<ll, ll> pii; #define rep(i, x, y) for (int i = x; i < y; i++) #define rept(i, x, y) for (int i = x; i <= y; i++) #define per(i, x, y) for (int i = x; i >= y; i--) #define all(x) x.be...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<ll, ll> pii; #define rep(i, x, y) for (int i = x; i < y; i++) #define rept(i, x, y) for (int i = x; i <= y; i++) #define per(i, x, y) for (int i = x; i >= y; i--) #define all(x) x.be...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
333
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define p_ary(ary, a, b) \ do { \ cout << "["; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define p_ary(ary, a, b) \ do { \ cout << "["; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
407
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long int LL; typedef pair<int, int> P; typedef pair...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long int LL; typedef pair<int, int> P; typedef pair...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
718
#include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long ll; const int dig = 52; inline ll read() { ll x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = (x << 3) + (x...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long ll; const int dig = 52; inline ll read() { ll x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = (x << 3) + (x...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
345
#include <iostream> using namespace std; int main() { char alpha; cin >> alpha; cout << (alpha > 90) ? 'a' : 'A'; return 0; }
#include <iostream> using namespace std; int main() { char alpha; cin >> alpha; cout << ((alpha > 90) ? 'a' : 'A'); return 0; }
[["+", 0, 16, 12, 23, 0, 41, 15, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 16, 12, 23, 0, 25]]
1
38
#include <ctype.h> #include <stdio.h> int main(void) { // Your code here! char c; scanf("%s", &c); if (isupper(c)) { printf('A'); } else { printf('a'); } }
#include <ctype.h> #include <stdio.h> int main(void) { // Your code here! char c; scanf("%s", &c); if (isupper(c)) { printf("A"); } else { printf("a"); } }
[["-", 0, 1, 0, 2, 3, 4, 0, 103, 0, 104], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62]]
0
51
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (a == 'A' or a == 'B' or a == 'C' or a == 'D' or a == 'E' or a == 'F' or a == 'G' or a == 'H' or a == 'I' or a == 'J' or a == 'K' or a == 'L' or a == 'M' or a == 'N' or a == 'O' or a == 'P' or a == 'Q' or a == 'R' or ...
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (a == 'A' or a == 'B' or a == 'C' or a == 'D' or a == 'E' or a == 'F' or a == 'G' or a == 'H' or a == 'I' or a == 'J' or a == 'K' or a == 'L' or a == 'M' or a == 'N' or a == 'O' or a == 'P' or a == 'Q' or a == 'R' or ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
198
n = input() s = abcdefghijklmnopqrstuvwxyz if n in s: print("a") else: print("A")
n = input() s = "abcdefghijklmnopqrstuvwxyz" if n in s: print("a") else: print("A")
[["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 654], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 655]]
5
27
from sys import stdin input = stdin.readline a = input().rstrip() if a.isupper: print("A") else: print("a")
from sys import stdin input = stdin.readline a = input().rstrip() if a.isupper(): print("A") else: print("a")
[["+", 0, 656, 0, 57, 15, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 57, 15, 652, 3, 4, 0, 25]]
5
37
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using p = pair<int, int>; typedef vector<int> vi; int main() { char alpha; if ((alpha >= 'a') && (alpha <= 'z')) { cout << 'a' << endl; } else if ((alpha >= 'A') && (alpha <= 'Z')) { c...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using p = pair<int, int>; typedef vector<int> vi; int main() { char alpha; cin >> alpha; if ((alpha >= 'a') && (alpha <= 'z')) { cout << 'a' << endl; } else if ((alpha >= 'A') && (alpha ...
[["+", 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
106
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; if (a >= 'A' && a <= 'Z') a = 'A'; else a = 'a'; cout << a << endl; }
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (a >= 'A' && a <= 'Z') a = 'A'; else a = 'a'; cout << a << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
52
x = input() y = x.isupper if (y == True): print("A") else: print("a")
x = input() y = x.isupper() if (y == True): print("A") else: print("a")
[["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
31
a=input() import string list1=list(string.ascii_lowercase) if a in list1 == 'true': print('a') else: print('A')
a=input() import string list1=list(string.ascii_lowercase) if a in list1: print('a') else: print('A')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 654], ["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 655]]
5
38
a=input() print('A' if a.islower() else 'a')
a=input() print('a' if a.islower() else 'A')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
21
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (a > 'A') { cout << "A" << endl; } else { cout << "a" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (a < 'a') { cout << "A" << endl; } else { cout << "a" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]]
1
48
t="qwertyuioplkjhgfdsazxcvbnm" T="QWERTYUIOPLKJHGFDSAZXCVBNM" a=str(input()) if a in t: print(a) else: print(A)
t="qwertyuioplkjhgfdsazxcvbnm" T="QWERTYUIOPLKJHGFDSAZXCVBNM" a=str(input()) if a in t: print('a') else: print('A')
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
33
#pragma region #define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cmath> #include <cstdint> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using name...
#pragma region #define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cmath> #include <cstdint> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using name...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
418
α = int(input()) if α.isupper(): print('A') else: print('a')
α = input() if α.isupper(): print('A') else: print('a')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
29
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define pb push_back #define f first #define s second #define lb lower_bound #define ub upper_bound typedef long long ll; typedef vector<int> vi; typedef unsigned long ul; typedef vector<ll> vl; typedef ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define pb push_back #define f first #define s second #define lb lower_bound #define ub upper_bound typedef long long ll; typedef vector<int> vi; typedef unsigned long ul; typedef vector<ll> vl; typedef ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
160
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define ll long long #define add push_back using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define ll long long #define add push_back using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
113
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (islower(a)) { cout << "A"; } else { cout << "a"; return 0; } }
#include <bits/stdc++.h> using namespace std; int main() { char a; cin >> a; if (islower(a)) { cout << "a"; } else { cout << "A"; return 0; } }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
46
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { char x; cin >> x; if ((int)x >= 90) cout << "a" << endl; else cout << "A" << endl; // cout << (int)x << endl; return 0; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { char x; cin >> x; if ((int)x > 90) cout << "a" << endl; else cout << "A" << endl; // cout << (int)x << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
61
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T, typename U> using or...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T, typename U> using or...
[["-", 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, 16, 31, 16, 12, 5, 0, 6]]
1
1,204
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define SCANF(i) \ int i; ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define SCANF(i) \ int i; ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
247
#include <algorithm> #include <iostream> #include <math.h> #include <numeric> #include <string> #define ll long long #define wolfe \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <algorithm> #include <iostream> #include <math.h> #include <numeric> #include <string> #define ll long long #define wolfe \ ios_base::sync_with_stdio(0); \ cin.tie(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
69
#include <iostream> using namespace std; int main() { char n; if (n <= 'Z' && n >= 'A') cout << 'A'; else cout << 'a'; }
#include <iostream> using namespace std; int main() { char n; cin >> n; if (n <= 'Z' && n >= 'A') cout << 'A'; else cout << 'a'; }
[["+", 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
42