source_code
stringlengths
26
62k
lang_cluster
stringclasses
11 values
src_uid
stringlengths
32
32
code_uid
stringlengths
32
32
difficulty
int32
-1
3.5k
exec_outcome
stringclasses
1 value
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
b9a35b7331a5805474041feb30208910
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
698f3344bbaef3f5ca7a9dd59d552dc3
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
09e013cd0a4ac74aaf02fd731af38acb
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
f0f388d415247cf54a17ad27a797c46e
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
5b1188d8661314f66562ce0694e64c0e
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
88d4a45ed43b57573b351965104689b2
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(){ int n; ...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
54b0feccee69709863b330d47d047708
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(){ int n; ...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
d093c88b4c7825ccdebc6e63c09acf02
1,700
PASSED
// https://codeforces.com/problemset/problem/1692/H // H. Gambling #include <iostream> #include <unordered_map> #include <tuple> using LLI = long long int; bool operator>(const std::tuple<LLI, int, int> a, const std::tuple<LLI, int, int> &b){ return std::get<0>(a) > std::get<0>(b); } void solve(){ int n; ...
C++
a07c199ca02f0abaab6c73efdb2a5b2d
0c4624b79717d4c8d260776c509bbaeb
1,700
PASSED
// Author: wlzhouzhuan #include<bits/stdc++.h> using namespace std; #define rep(i,l,r) for(int i=(l);i<=(r);i++) #define per(i,l,r) for(int i=(l);i>=(r);i--) #define ll long long #define ull unsigned long long #define pii pair<int,int> #define mset(s,t) memset(s,t,sizeof(s)) #define mcpy(s,t) memcpy(s,t,size...
C++
c0068963008fdf04ba4261d32f4162a2
688d443a56e9c7c198808032a94fc158
3,100
PASSED
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; const int N = 500005; const int INF = 0x3f3f3f3f; int n, a[N], res; int f[N]; int t, x; void cmin(int &x, int y) { x = x < y ? x : y; } void cmax(int &x, int y) { x = x > y ? x : y; } /* bool check() { int inc = finc[x], dec; ...
C++
c0068963008fdf04ba4261d32f4162a2
4cb6ecc3a37501af48ba1e6276239c4e
3,100
PASSED
/** * author: ivanzuki * created: Sat May 28 2022 **/ #include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C,...
C++
c0068963008fdf04ba4261d32f4162a2
de3a1fa02e608e20182c4a4abb40b534
3,100
PASSED
#include<bits/stdc++.h> using namespace std; #define rep(v,l,r) for(int v=l;v<=r;++v) #define Rep(v,l,r) for(int v=l;v>=r;--v) #define upmin(x,y) x=min(x,y) #define upmax(x,y) x=max(x,y) const int N=6e5,INF=2e9; int n,a[N],f[N],g[N],dp0[N],dp1[N],mx,res; void work() { mx=max_element(a+1,a+n+1)-a; mem...
C++
c0068963008fdf04ba4261d32f4162a2
a348149b2dedfb414b4c61c687c667db
3,100
PASSED
#include<bits/stdc++.h> using namespace std; #define rep(v,l,r) for(int v=l;v<=r;++v) #define Rep(v,l,r) for(int v=l;v>=r;--v) #define upmin(x,y) x=min(x,y) #define upmax(x,y) x=max(x,y) const int N=6e5,INF=2e9; int n,a[N],f[N],g[N],dp0[N],dp1[N],mx,res; void work() { mx=max_element(a+1,a+n+1)-a; mem...
C++
c0068963008fdf04ba4261d32f4162a2
7e935922a7f3362648ad92cabd1d6a2b
3,100
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long #define lll __int128 #define lb long double #define D double #define psb push_back #define mkp make_pair #define min3(xxx,yyy,zzz) min(min(xxx,yyy),zzz) #define max3(xxx,yyy,zzz) max(max(xxx,yyy),zzz) #define gi greater<int> #define gl...
C++
c0068963008fdf04ba4261d32f4162a2
180a0bf175d52bee7412afdc00b72b4f
3,100
PASSED
#include<bits/stdc++.h> using namespace std; using LL = long long; struct P{ int a, b; P(): a(0), b(0){} void add(int x) { if (a == -1) return; if (x > b) b = x; else if (x > a) a = x; else a = b = -1; } }; int main() { ios::sync_with_stdio(false); ...
C++
c0068963008fdf04ba4261d32f4162a2
0724b94e597f8c7dcccdb6ae685598dd
3,100
PASSED
#line 1 "library/my_template.hpp" #include <bits/stdc++.h> using namespace std; using ll = long long; using pi = pair<ll, ll>; using vi = vector<ll>; using u32 = unsigned int; using u64 = unsigned long long; using i128 = __int128; template <class T> using vc = vector<T>; template <class T> using vvc =...
C++
c0068963008fdf04ba4261d32f4162a2
7892cbba3ba7b5ad0af073546697fe7a
3,100
PASSED
//我耳朵瞎掉拉~~ #define setI(x) freopen(x,"r",stdin) #define setO(x) freopen(x,"w",stdout) #include<bits/stdc++.h> #define poly vector<int> #define IOS ios::sync_with_stdio(false) #define ll long long #define mp make_pair #define mt make_tuple #define pa pair < int,int > #define fi first #define se second #defin...
C++
c0068963008fdf04ba4261d32f4162a2
7b25d2667c0d1cd342e635808137f736
3,100
PASSED
#include <bits/stdc++.h> using namespace std; #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' typedef long long ll; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3f; int n; int solve(vector<int> v) { int maxi = -1, id; for (int i = 0; i < n; i++) if (v[i] > maxi) maxi = v[i], ...
C++
c0068963008fdf04ba4261d32f4162a2
97c173566e7104b7d83b33b51f3949cf
3,100
PASSED
#include<bits/stdc++.h> using namespace std; int const nax = 3e5 + 10; bool is_prime(int64_t x) { for (int64_t j = 2 ; j * j <= x ; ++ j) { if (x % j == 0) return false; } return true; } int64_t sm_prime(int64_t x) { for (int64_t j = 2 ; j * j <= x ; ++ j) { if (x % j == 0) ...
C++
ee27020ca43546993b82357527585831
e8439bce5341db3e41a56a1c5bdbd809
1,900
PASSED
#include <bits/stdc++.h> using namespace std; bool ispow(int d, int k) { bool a=false; if (d>k and k>1) { int po=round(log(d)/log(k)); a=(pow(k,po)==d); } return a; } bool notprime(int x) { bool a=false; for (int i=2; i<=sqrt(x); i++) { if (x%i==0) { ...
C++
ee27020ca43546993b82357527585831
3ebcabe699d18203e1417b650d688840
1,900
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define all(x) (x).begin(), (x).end() #define uniq(v) (v)....
C++
ee27020ca43546993b82357527585831
68e1d3c0764c5107ff836628098970db
1,900
PASSED
#include<bits/stdc++.h> using namespace std; int s(int n) { int i,l=-1; for(i=2;i*i<=n;i++) { if(n==i*i) l=i; } return l; } int main() { long long int t,n,i,ck,d2,d,two,x; double y; cin>>t; while(t--) { cin>>n>>d; two=0; ...
C++
ee27020ca43546993b82357527585831
2012cffbc099e523ae71df88a69a8dd7
1,900
PASSED
#include <bits/stdc++.h> using namespace std; int prime(int x) { for (int i = 2; i * i <= x; ++i) { if (x % i == 0) return i; } return -1; } void solve() { int x, d; cin >> x >> d; int cnt = 0; while (x % d == 0) { ++cnt; x /= d; ...
C++
ee27020ca43546993b82357527585831
d03f1e56c7742c6b23edf6b4df3e0b51
1,900
PASSED
#include <iostream> #include<bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define endl "\n" #define vi vector<int> #define vii vector<pair<int,int>> #define pb push_back using namespace std; using ll = long long; const ll mod = 1e9+7; ll fac[1000001]; void pre(){ fac[0]=fac[1]=1; for(...
C++
ee27020ca43546993b82357527585831
a800cf767923bff072caa8c9502d98c8
1,900
PASSED
#include <bits/stdc++.h> #define F0R(i,n) for(int i=0; i<(n); i++) #define FOR(i,a,b) for(int i=(a); i<=(b); i++) #define ROF(i,a,b) for(int i=(a); i>=(b); i--) #define ll long long #define F first #define S second using namespace std; int countFac(ll n){ int res = 0; for(ll i = 2; i*i <= n; i++){ ...
C++
ee27020ca43546993b82357527585831
1d4f02efb1e077083545472a2b13bf4d
1,900
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; int t; ll x,d; bool prime(ll x){ if(x<4) return 1; for(ll i=2;1ll*i*i<=x;i++){ if(x%i==0) return 0; } return 1; } int main(){ cin>>t; while(t--){ cin>>x>>d; if(x%(d*d)!=0){ puts("NO"); conti...
C++
ee27020ca43546993b82357527585831
fb69791097ad5c55a65f7eb7ad56663d
1,900
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long int #define dd double #define sg string #define modd 1000000007 #define en "\n" #define sc(a) scanf("%lld",&a); #define f(i,a,n) for(ll i=a;i<n;i++) #define ps(a) printf("%lld ",a); #define pn(a) printf("%lld\n",a); ll prime(ll num){ ...
C++
ee27020ca43546993b82357527585831
6bb6f686622fec20f21ff101e60e0154
1,900
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long int #define dd double #define sg string #define modd 1000000007 #define en "\n" #define sc(a) scanf("%lld",&a); #define f(i,a,n) for(ll i=a;i<n;i++) #define ps(a) printf("%lld ",a); #define pn(a) printf("%lld\n",a); ll prime(ll num){ ...
C++
ee27020ca43546993b82357527585831
1f1aaeab2bf575a03f6d79d18a93da2e
1,900
PASSED
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ll long long int #define llu unsigned long long int #define dl double #define scll(x) scanf("...
C++
b44d59eded2cb3a65686dc7fd07d21b7
a41b73a8a27be827c0b31462d5600f7d
1,200
PASSED
#include <bits/stdc++.h> using namespace std; #define debug freopen("in.in","r",stdin);freopen("out.out","w",stdout); #define IO ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); #define rep(i, l, r) for(int i = (l); i <= (r); i++) #define per(i, r, l) for(int i = (r); i >= (l); i--) #define pb push...
C++
b44d59eded2cb3a65686dc7fd07d21b7
f6704c7a6972845789c97cabe3dc12a3
1,200
PASSED
#include<bits/stdc++.h> using namespace std; #define all(a) a.begin(),a.end() #define OO ll(1e9) #define MOD ll(OO + 7) #define IO cin.tie(0);std::ios::sync_with_stdio(false) #define set(a,b) memset(a,b,sizeof(a)) #define rep(i,b,n) for(int i=b;i<n;i++) typedef unsigned long long ull; typedef long long ll; co...
C++
b44d59eded2cb3a65686dc7fd07d21b7
12c1e62763233cb0bfee92c9facb8384
1,200
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; typedef pair<int, int> PII; void solve() { int n, m; cin >> n >> m; string a[n]; for (int i = 0; i < n; i ++ ) cin >> a[i]; for (int i = 0; i < n - 1; i ++ ) for (int j = 0; j < m - 1; j ++ ) ...
C++
b44d59eded2cb3a65686dc7fd07d21b7
b1a51aea027c36f113d6c417f60af182
1,200
PASSED
#include<bits/stdc++.h> #define x first #define y second #define int long long using namespace std; void solve() { int n, m; cin >> n >> m; vector<string> a(n); for (int i = 0; i < n; i ++ ) cin >> a[i]; for (int i = 0; i < n - 1; i ++ ) for (int j = 0; j < m - 1; j ++ ) ...
C++
b44d59eded2cb3a65686dc7fd07d21b7
e8043276b801059e988a76fd741cd646
1,200
PASSED
#include<bits/stdc++.h> #define x first #define y second #define int long long using namespace std; typedef pair<int, int> PII; const int N = 110, inf = 2e9; void solve() { int n, m; cin >> n >> m; bool flag = true; vector<string> a(n); for (int i = 0; i < n; i++) cin >> a[i...
C++
b44d59eded2cb3a65686dc7fd07d21b7
acd240290b4ca3a20be7c98e4a2dc147
1,200
PASSED
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t, n, m; string str[1001]; cin >> t; while(t--) { cin >> n >> m; bool cek = true; for(int i = 1; i ...
C++
b44d59eded2cb3a65686dc7fd07d21b7
d4b529bcbf40ef8503b5c0df5f4d2ca0
1,200
PASSED
/*/-----------------------sdeepanshu17-----------------------/*/ #include <bits/stdc++.h> using namespace std; #define fastIO {ios_base ::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);} #define int long long #define mod 1000000007 #define PI 3.1415926535897932...
C++
b44d59eded2cb3a65686dc7fd07d21b7
48818dd00fdb1d1f69bf347f7dac38ee
1,200
PASSED
#include <bits/stdc++.h> using namespace std; //#pragma GCC optimize(2); #define IOS ios::sync_with_stdio(false) ,cin.tie(0), cout.tie(0); const double PI = acos(-1.0); typedef long long ll; const int N = 1e6 + 5; const int M = 1e5 + 5; const double eps =1e-13; const ll mod = 998244353; const int INF = 0x3f3...
C++
b44d59eded2cb3a65686dc7fd07d21b7
ff77a34ea51f131af49ceac89a1cd83a
1,200
PASSED
#include<bits/stdc++.h> using namespace std; #define fast {ios_base::sync_with_stdio(false); cin.tie(0);} typedef long long ll; #define pb push_back #define eb emplace_back #define mem(x,i) memset(x,i,sizeof(x)) #define ff first #define ss second #define all(x) x....
C++
b44d59eded2cb3a65686dc7fd07d21b7
baa2feb9f8bbbee2ef8c87b540c37e38
1,200
PASSED
#include <bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f3f3f3f3fLL #define mod 1e9+7 #define INT long long #define x first #define y second char s[200][200]; int a[200][200]; int main(){ #ifndef ONLINE_JUDGE // freopen("in.in", "r", stdin); // freopen("out.out", "w", stdout); #endif int t; cin>>t; while(...
C++
403805b6986a1dc8560052cf33a7cf18
8a4667d4699319e1f6f1a59e4bced65e
1,300
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long INT; const int NN = 150; char s[NN][NN]; int main() { #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); //freopen("out.out", "w", stdout); #endif int t; cin >> t; int n, m; while(t -- ){ scanf("%d%d", &n, &m); for(int i = 1; i <= n; i ++){ scan...
C++
403805b6986a1dc8560052cf33a7cf18
d9bfbc38ed30e655c53a12dde08a9ee0
1,300
PASSED
#include <bits/stdc++.h> using namespace std; const int NN = 110; char s[NN]; int A[NN][NN], a1[NN*NN], a2[NN*NN], a3[NN*NN], a4[NN*NN]; int main() { #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); freopen("out.out", "w", stdout); #endif int t, n, m, cnt; cin>>t; while(t --){ scanf("%d%d", &n, &m); for(int ...
C++
403805b6986a1dc8560052cf33a7cf18
27f9fa9246145557dd6ae55198154c50
1,300
PASSED
#include <bits/stdc++.h> #define NN 600010 #define INT long long #define INF 1000000007 #define pii pair<INT,INT> #define x first #define y second using namespace std; int A[200][200],C[200][200],D[NN],ans[NN]; char B[NN]; int main() { int q; scanf("%d", &q); for(int ta = 1;ta <= q;ta ++){ int n,m; cin>>n>>m; ...
C++
403805b6986a1dc8560052cf33a7cf18
e008d479ceed91b824b2f8794b54c726
1,300
PASSED
#include <bits/stdc++.h> #define x first #define y second using namespace std; typedef pair<int, int> pii; typedef pair<pii, pii> pi4; char s[111][111]; int main() { #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); freopen("out.out", "w", stdout); #endif int T; cin >> T; while (T--) { int n, m; scanf(...
C++
403805b6986a1dc8560052cf33a7cf18
656ddb394377dbd04c54d2f704931f6f
1,300
PASSED
#include<bits/stdc++.h> #define NN 110 using namespace std; char a[NN][NN]; int main(){ #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); //freopen("out.out", "w", stdout); #endif int t; cin>>t; while(t--){ int n,m; scanf("%d%d",&n,&m); for(int i = 0 ; i < n ;i ++) scanf("%s",a[i]); if(a[0][0]=='1') pri...
C++
403805b6986a1dc8560052cf33a7cf18
82ec13068c67800641d55dc5146ae388
1,300
PASSED
#include<bits/stdc++.h> using namespace std; char s[111][111]; void solve() { int n, m; cin >> n >> m; for(int i = 0; i < n; i++) { scanf("%s", s[i]); } if(s[0][0] == '1') { puts("-1"); return; } vector<pair<pair<int, int>, pair<int ,int>>> ans; for(int i = n - 1; i >= 0; i --) { for(int j = m - 1; j >= ...
C++
403805b6986a1dc8560052cf33a7cf18
9b4a012e520a2761221b9fd715d9f37d
1,300
PASSED
#include<bits/stdc++.h> #define NN 110 #define y second #define x first using namespace std; using INT=long long; using pii = pair <int, int>; using ppi = pair <pii, pii>; int a[NN][NN], b[NN][NN]; int main() { #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); freopen("out.out", "w", stdout); #endif int t; cin >...
C++
403805b6986a1dc8560052cf33a7cf18
6533e011b9d077a3f6f2ab4468c03970
1,300
PASSED
#include<bits/stdc++.h> #define pb push_back #define x first #define y second using namespace std; using DO=double; using INT=long long; using pii=pair<int,int>; using pi3=pair<pii,int>; int power(int a,int b,int mod,int ans=1){ for(;b;b>>=1,a=1LL*a*a%mod) if(b&1) ans=1LL*ans*a%mod; return ans; } char s[111][111]; ve...
C++
403805b6986a1dc8560052cf33a7cf18
b79e975aef6e9a2d59899fa581983a1a
1,300
PASSED
#include<bits/stdc++.h> using namespace std; using INT = long long; const int NN = 111; int a[NN][NN]; int main() { #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); freopen("out.out", "w", stdout); #endif int T; cin >> T; while(T--) { int n, m; cin >> n >> m; int s = 0; for(int i = 1; i <= n; i ++)...
C++
403805b6986a1dc8560052cf33a7cf18
0ff6e1daa22069d41cd0c2e2d1583b1b
1,300
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
c085971855e2a0a3c33f0eb44fb06514
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
97ef48d19463cdc133b0a0dda3e49880
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
63dbf7b2a0b324c8f5c958aa1001916c
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
057fef0415c221fa0a55a1751f9e825a
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
36c2aed509e2f06bfe11c00b0779a157
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
cd685cf516a3db89bfa7c248f9c5a415
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
db0be7ba9202038bd154f843e4b76570
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
a669161a1bed07c50c03017fbb936fcf
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
909af5172a5af4904a7d217ab229b557
800
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) typedef vector<int> VI; typedef ...
C++
1a5f266b49aadbeef59e19bcf5524a57
35323d6f0618bc6a410507b755594885
800
PASSED
#include<bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #define dbg(x...) do { cout << "\033[33;1m " << #x << " -> "; err(x); } while (0) void err() { cout << "\033[39;0m" << endl; } template<template<typename...> class T, typename t, typename... A> void err(T<t> a, A... x) { for (auto v: a) cout << v << ' ';...
C++
5e715f2d2e4fe54df4b93619c53c8457
3ecab3d9d2ed848bc63d12b37ac545e4
2,500
PASSED
#include <bits/stdc++.h> using namespace std; const int K = 30; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> cnt(n); vector<vector<int>> up(n, vector<int> (K)); for (int i = 0; i < n; ++i) { int a; cin >> a; ...
C++
5e715f2d2e4fe54df4b93619c53c8457
24b9048ab2e24acad073bfe08b19901a
2,500
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; namespace IO { template <typename T> inline void read(T &x) { x=0;int y=1; char c=getchar(); while(c<'0'||c>'9'){if(c=='-')y=-1; c=getchar();} while(c>='0'&&c<='9'){x=x*10+c-'0'; c=getchar();} x*=y; return; } template <type...
C++
5e715f2d2e4fe54df4b93619c53c8457
1c5e43a17a397110b8b2a01bf184dd02
2,500
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; namespace IO { template <typename T> inline void read(T &x) { x=0;int y=1; char c=getchar(); while(c<'0'||c>'9'){if(c=='-')y=-1; c=getchar();} while(c>='0'&&c<='9'){x=x*10+c-'0'; c=getchar();} x*=y; return; } template <type...
C++
5e715f2d2e4fe54df4b93619c53c8457
9a574ca66863a8f97ef0787adca6d221
2,500
PASSED
//倍增, 贪心, set维护 #include <bits/stdc++.h> #define int long long using namespace std; namespace IO{ template <typename T> inline void write(T x) { if(x < 0) putchar('-') , x = - x; if(x == 0) { putchar('0'); return ; } if(x > 9) write(x / 10); putchar(x %...
C++
5e715f2d2e4fe54df4b93619c53c8457
4caa4cf97f5af984d35710c87e5d4598
2,500
PASSED
#include <cstdio> #include <vector> using namespace std; int up[100001][30]; bool flag[100001]; int a[100001], tmp[100001], seat[100001]; vector<int> from[100001]; int heap[100001], heap_size = 0, n; int ini[100001]; int binary_search(int now, int times) { if (times == 0) return now; e...
C++
5e715f2d2e4fe54df4b93619c53c8457
a929a07f4b3e6a4940396c91d0fc1e94
2,500
PASSED
#include<set> #include<map> #include<queue> #include<cassert> #include<vector> #include<iomanip> #include<iostream> #include<algorithm> #include<functional> #include<unordered_map> #include<unordered_set> using namespace std; const long long mod = 1000000007; template<class T> void print(const v...
C++
5e715f2d2e4fe54df4b93619c53c8457
e46987b318914cd2f9198c349c1fc0d9
2,500
PASSED
#include<bits/stdc++.h> #define orz puts("%%%wyy332623"); #define N 200005 using namespace std; inline int read(){ int x=0,w=1; char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')w=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); return x*w; } int n,maxn...
C++
5e715f2d2e4fe54df4b93619c53c8457
224c1cc5819689a5b8f8598c2f2f03b5
2,500
PASSED
#include<bits/stdc++.h> #define orz puts("%%%wyy332623"); #define N 200005 using namespace std; inline int read(){ int x=0,w=1; char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')w=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); return x*w; } int n,maxn...
C++
5e715f2d2e4fe54df4b93619c53c8457
c9aa4005d43e8dd90a7d19a7f6add0a8
2,500
PASSED
#include<bits/stdc++.h> #define orz puts("%%%wyy332623"); #define N 200005 using namespace std; inline int read(){ int x=0,w=1; char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')w=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar(); return x*w; } int n,maxn...
C++
5e715f2d2e4fe54df4b93619c53c8457
38a9fdeee4d8c41eb6c8eeaf1f2cbcbb
2,500
PASSED
#include<bits/stdc++.h> using namespace std; int const N=2333; int n,flg[N]; char mp[N][N]; inline void update(int x,int p){ if(flg[x]!=-1&&flg[x]!=p)cout<<"NONE\n",exit(0); flg[x]=p; } inline void print(int x,int p){ cout<<(flg[x]^p?"S":"G"); } int main(){ ios::sync_with_stdio(0); cin>>n; if(n&1)c...
C++
4425c6660c9e9c037e32c2e1c081b9c1
8c5482ab6363f2619aebae5df2a58247
3,500
PASSED
#include<bits/stdc++.h> using namespace std; int const N=2333; int n,flg[N],ord[N][N]; char mp[N][N]; inline void update(int i,int j,int x,int p){ ord[i][j]=x; // cout<<i<<" "<<j<<" "<<x<<" "<<p<<"\n"; if(flg[x]!=-1&&flg[x]!=p) cout<<"NONE\n",exit(0); flg[x]=p; } inline void print(int i,int j,int x,int...
C++
4425c6660c9e9c037e32c2e1c081b9c1
376ab7c62c186147a826bdac1277151e
3,500
PASSED
#include<iostream> #include<cstdio> #define N 2000 //use int,don't use short,use only 4*N*N edges,use 6*N*N edges will be MLE. using namespace std; int read() { char c=0; int sum=0; while (c<'0'||c>'9') c=getchar(); while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar(); return sum; } struct node { int v,data,nxt; }...
C++
4425c6660c9e9c037e32c2e1c081b9c1
5c17b6f23f8bc48eed23b024e69b5f14
3,500
PASSED
#include<iostream> #include<cstdio> #define N 2000 using namespace std; int read() { char c=0; int sum=0; while (c<'0'||c>'9') c=getchar(); while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar(); return sum; } struct node { int v,data,nxt; }; node edge[4*N*N+1]; int n,cl[N*N+1],head[N*N+1],len; char c[N+1][N+1]; int...
C++
4425c6660c9e9c037e32c2e1c081b9c1
a3a856edbb44b749cf9534f2fd17d7bf
3,500
PASSED
#include<bits/stdc++.h> //#pragma GCC optimize(2) using namespace std; #define pii pair<int,int> #define ll long long #define il inline #define fst first #define scd second #define reg register #define err() cout<<"err "<<__LINE__<<endl,exit(0) #define pot(args...) \ GPT(#args),cout<<" Line "<<__LINE__<<"\...
C++
4425c6660c9e9c037e32c2e1c081b9c1
750b46a3c108de43962ae02a88600cf1
3,500
PASSED
//an awesome problem. #include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i ++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i ++) #define MP make_pair using namespace std; typedef long long LL; typedef pair<int, int> PII; const int MOD = 998244353; int absv(int x) { return x < 0...
C++
4425c6660c9e9c037e32c2e1c081b9c1
7d16529e6f80c1b1bb6860e71a86baed
3,500
PASSED
#include<bits/stdc++.h> #define File(name) freopen(#name".in", "r", stdin); freopen(#name".out", "w", stdout); #define ri register int #define Int inline int #define Void inline void #define Bool inline bool #define LL inline long long using namespace std; typedef long long ll; typedef unsigned long long ull; typedef p...
C++
4425c6660c9e9c037e32c2e1c081b9c1
663d3709fbf0f2dfcffcd015cebfaf6d
3,500
PASSED
#include<bits/stdc++.h> #define File(name) freopen(#name".in", "r", stdin); freopen(#name".out", "w", stdout); #define ri register int #define Int inline int #define Void inline void #define Bool inline bool #define LL inline long long using namespace std; typedef long long ll; typedef unsigned long long ull; ...
C++
4425c6660c9e9c037e32c2e1c081b9c1
ec5bbf74cc87e9ce1e7bb32c4c2ddd0b
3,500
PASSED
#include<bits/stdc++.h> using namespace std; struct block{ int opt,col; }chk[2005][2005]; int n,cnt=0; void gopt(int x,int y){ int now=0,posx=x,posy=y; //upper line chk[x][y].opt=chk[x][y+1].opt=cnt,chk[x][y].col=chk[x][y+1].col=now; //diagonal going down right posx=x+1,posy=y+2; while(posy<=n){ n...
C++
4425c6660c9e9c037e32c2e1c081b9c1
c8eb40947838de5d337465c713620c78
3,500
PASSED
/** * @brief codeforces * @author yao */ #include <cstdlib> #include <cstdio> #include <cctype> #include <cstring> #include <utility> #include <algorithm> #include <functional> #include <climits> #define ft first #define sd second #ifdef DBG # define dbg_pri(x...) fprintf(stderr,x) #else # define dbg_pri(x......
C++
4425c6660c9e9c037e32c2e1c081b9c1
89f987259c8b6dace578a83f28ae806e
3,500
PASSED
#include<iostream> using namespace std; int main() { int m,n; cin>>m; while(m--) {cin>>n; cout<<n<<endl;} return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
53111a04afac796f1a7604fc943462ac
800
PASSED
#include<stdio.h> #include<math.h> int su(int x) {int i; for(i=2;i<=sqrt(x);i++) if(x%i==0)break; if(i<=sqrt(x)) return 0; else return 1;} main() { int i,n,j; scanf("%d",&i); while(i--) {scanf("%d",&n); for(j=2;j<100000;j++) if(su(n+j)==0&&su(j)) break; printf("%...
C++
b7e36ca8a96dd7951359070d4953beec
172c338b2be145cd9a9c1830a1990a77
800
PASSED
#include<iostream> using namespace std; int main() { int n; cin >> n; while(n--) cout << 7 << endl; return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
99d14842f6e0e396ce0a526e79875b36
800
PASSED
#include<iostream> using namespace std; int main() { int n,a; cin>>n; for(int i=0;i<n;i++) { cin>>a; cout<<"7"<<endl; } }
C++
b7e36ca8a96dd7951359070d4953beec
f6f2ad3f25f95dfccf5fd73777b30561
800
PASSED
#include<stdio.h> int main() { int n; scanf("%d",&n); int x; for(int i=1;i<=n;i++) { scanf("%d",&x); printf("%d\n",x); } return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
7a25f4413cf49ebb799462111579bb54
800
PASSED
#include<stdio.h> int main(){ int n; scanf("%d",&n); int x; for(int i=0;i<n;++i){ scanf("%d",&x); printf("%d\n",x); } }
C++
b7e36ca8a96dd7951359070d4953beec
2741555f87283113ee4c684bd2ff8179
800
PASSED
#include<stdio.h> int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); if(n%2!=0) printf("3\n"); else printf("2\n"); } return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
a65ec1b894311e15193bc9dff005486f
800
PASSED
#include <iostream> using namespace std; int main() { int t; cin >> t; while(t--) { int n; cin >> n; if(n%2==0) cout << 2 << endl; else cout << 3 << endl; } return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
efe08b22b2da5e8bbc15cdc1d4783f7e
800
PASSED
#include<stdio.h> int main() { int t; scanf("%d", &t); while(t--) { int a; scanf("%d", &a); printf("7\n"); } return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
7c6d554da67007a7ae32ac2c537bedec
800
PASSED
#include <iostream> using namespace std; int main() { int t; cin >> t; while(t--) { int n; cin >> n; if(n%2==0) cout << 2 << endl; else cout << 3 << endl; } return 0; }
C++
b7e36ca8a96dd7951359070d4953beec
6858ed92400f630f47537ef5c056459b
800
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; int32_t main(){ int t; cin>>t; while(t--){ int n, t1, t2; cin>>n; int a[n+1]={0}; for(int i=1;i<=n;i++)cin>>a[i]; sort(a+1, a+n+1); int j=1; for(int i=1;i<n-1;i++){ ...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
4e5d42653597f821d4d3f842eadd4c43
1,400
PASSED
#include <bits/stdc++.h> #define lb(x) (x & -x) #define lc(p) (p << 1) #define rc(p) (p << 1 | 1) using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int INF = 0x3f3f3f3f; int main() { int t; cin >> t; while(t--) { int n; cin >> n; ...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
fc04b0d9419c620ae13d5cf3fed88098
1,400
PASSED
#include <bits/stdc++.h> #define lb(x) (x & -x) #define lc(p) (p << 1) #define rc(p) (p << 1 | 1) using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int INF = 0x3f3f3f3f; int main() { int t; cin >> t; while(t--) { int n; cin >> n; ...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
11241f74a3ee47ab3b185b13ad06641d
1,400
PASSED
#include <bits/stdc++.h> #define int long long //(�г�ʱ����) #define endl '\n' #define NO {cout<<"NO"<<endl;} #define YES {cout<<"YES"<<endl;} #define x first #define y second using namespace std; typedef long long ll; typedef pair<int,int>PII; const int N=2000010,M=1010,mod=1e9+7,INF=0x3f3f3f3f; int a[...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
ef660374bca5e4ff32bcd3dc45c42113
1,400
PASSED
#include <bits/stdc++.h> #define int long long //(?��??????) #define endl '\n' #define NO {cout<<"NO"<<endl;} #define YES {cout<<"YES"<<endl;} #define x first #define y second using namespace std; typedef long long ll; typedef pair<int,int>PII; const int N=200010,M=1010,mod=1e9+7,INF=0x3f3f3f3f; PII h[...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
35a793d23619c07cb223f1bfc4bf57b0
1,400
PASSED
#include <bits/stdc++.h> #define int long long //(?��??????) #define endl '\n' #define NO {cout<<"NO"<<endl;} #define YES {cout<<"YES"<<endl;} #define x first #define y second using namespace std; typedef long long ll; typedef pair<int,int>PII; const int N=2000010,M=1010,mod=1e9+7,INF=0x3f3f3f3f; int b...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
78ee265dc08f4da2e15151c3db0b6c17
1,400
PASSED
#include <bits/stdc++.h> #define int long long //(�г�ʱ����) #define endl '\n' #define NO {cout<<"NO"<<endl;} #define YES {cout<<"YES"<<endl;} #define x first #define y second using namespace std; typedef long long ll; typedef pair<int,int>PII; const int N=2000010,M=1010,mod=1e9+7,INF=0x3f3f3f3f; int b[...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
94c608c5cb5f71ff027ea9ff55b6d5e2
1,400
PASSED
#include <bits/stdc++.h> #define int long long //(�г�ʱ����) #define endl '\n' #define NO {cout<<"NO"<<endl;} #define YES {cout<<"YES"<<endl;} #define x first #define y second using namespace std; typedef long long ll; typedef pair<int,int>PII; const int N=2000010,M=1010,mod=1e9+7,INF=0x3f3f3f3f; int a[...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
8226640ea6b45be017adfa5261f63dee
1,400
PASSED
// never use inbuilt sqrt function // if calculated the answer then reuse it never calculate from starting #830 div 2 #include<bits/stdc++.h> using namespace std; #define int long long void solve(){ int n; cin>>n; vector<int> a(n); for(int i=0; i<n; i++){ cin>>a[i]; } sort(a.begin...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
de514d05783e17d7effecc5e183337f8
1,400
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 2e5 + 10; typedef long long LL; LL a[N]; void solve() { unordered_map<int, int> s, t, mp; int n; cin >> n; int cnt = 0; for(int i = 1; i <= n; i ++) cin >> a[i]; sort(a + 1, a + n + 1); LL sum = a[n] - a[1]; for(int i = 1; i <...
C++
7421b2392cb40f1cf0b7fd93c287f1eb
92df99e6cd81ba80ba7f88fa1b454074
1,400
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; void testcase(){ int n,m,k;cin>>n>>m>>k; vector<int>a(k); for(int i=0;i<k;i++){ cin>>a[i]; } int places=n*m-2; vector<bool>was(k+1); int nxt=k; for(int card:a){ if(nxt==card){ ...
C++
aaebae32edfe31f45bbe95c185f5460f
e0dc095f977ef7a97d389c18f496d2f3
1,500
PASSED