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
#include <bits/stdc++.h> using namespace std; /*<DEBUG>*/ #define tem template <typename #define can_shift(_X_, ...) enable_if_t<sizeof test<_X_>(0) __VA_ARGS__ 8, debug&> operator<<(T i) #define _op debug& operator<< tem C > auto test(C *x) -> decltype(cerr << *x, 0LL); tem C > char test(...); tem C > struct itr{C b...
C++
6f6bb98cee5c9e646c72f3be8969c6df
b02a8ed69d3b3e5f3effc4e6fee17aea
2,400
PASSED
#include <bits/stdc++.h> using namespace std; /*<DEBUG>*/ #define tem template <typename #define can_shift(_X_, ...) enable_if_t<sizeof test<_X_>(0) __VA_ARGS__ 8, debug&> operator<<(T i) #define _op debug& operator<< tem C > auto test(C *x) -> decltype(cerr << *x, 0LL); tem C > char test(...); tem C > struct itr{C b...
C++
6f6bb98cee5c9e646c72f3be8969c6df
59e5c76c050e0b27f82195492244407f
2,400
PASSED
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math") #pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native") #include <bits/stdc++.h> using namespace std; #define rep(i,h,t) for (int i=h;i<=t;i++) #define dep(i,t,h) for (int i=t;i>=h;i--) #define ll long long const ...
C++
6f6bb98cee5c9e646c72f3be8969c6df
54e081468e263d9fc5d4b7bab21ebf6e
2,400
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,h,t) for (int i=h;i<=t;i++) #define dep(i,t,h) for (int i=t;i>=h;i--) #define ll long long const int N=3e5+10; unordered_map<int,int> M[N]; int n,a[N],b[N]; ll ve0[N],ve1[N],sum0[N],sum1[N],cnt0,cnt1; int mu[N],prime[N],num,ol[N]; void get() { ...
C++
6f6bb98cee5c9e646c72f3be8969c6df
4061a4d915e2adc905be70da63f5f224
2,400
PASSED
#include <bits/stdc++.h> using namespace std; #define rep(i,h,t) for (int i=h;i<=t;i++) #define dep(i,t,h) for (int i=t;i>=h;i--) #define ll long long const int N=3e5+10; unordered_map<int,int> M[N]; int n,a[N],b[N]; ll ve0[N],ve1[N],sum0[N],sum1[N],cnt0,cnt1; int mu[N],prime[N],num,ol[N]; void get() { ...
C++
6f6bb98cee5c9e646c72f3be8969c6df
6930014b57319c8e4c679b17b52277d4
2,400
PASSED
#include <bits/stdc++.h> //#include <ext/rope> //#include <ext/pb_ds/assoc_container.hpp> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native") #pragma GCC target("avx,avx2") using namespace std; //using namespace __gnu_cxx...
C++
6f6bb98cee5c9e646c72f3be8969c6df
b89356967c4b5e2156f317b69f1fa472
2,400
PASSED
#include <bits/stdc++.h> #define pb push_back #define ll long long #define ull unsigned long long #define mp make_pair #define si short int #define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #define pill pair<ll,ll> #define f first #define s second #define pilc pair<ll,char> #define all(a) (a)...
C++
6f6bb98cee5c9e646c72f3be8969c6df
6309726caaf3403647380dd939745cfa
2,400
PASSED
//#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma") //#pragma GCC optimization ("unroll-loops") //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #...
C++
6f6bb98cee5c9e646c72f3be8969c6df
0919fa8d7d873be7daa4f746791aa0ec
2,400
PASSED
//#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma") //#pragma GCC optimization ("unroll-loops") //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #...
C++
6f6bb98cee5c9e646c72f3be8969c6df
6f190fde2bd491aad41c574508e67cf8
2,400
PASSED
#include<bits/stdc++.h> #define For(i,a,b) for(int i=(a),i##END=(b);i<=i##END;i++) #define Rof(i,b,a) for(int i=(b),i##END=(a);i>=i##END;i--) #define go(u) for(int i=head[u];i;i=nxt[i]) #define int long long using namespace std; inline int read(){ int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
881e58072092495ec9fbe9b94ac532b8
2,900
PASSED
// qwq #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <int, int> pii; #define fi first #define se second #define ep emplace #define rez resize #define pb push_back #define mkp make_pair #define debug(...) fprintf (stderr, __VA_ARGS__) #define Lep(i, l, r) for (int i =...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
c3ca2565753173254b01072d7980bedf
2,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <int, int> pii; #define fi first #define se second #define ep emplace #define rez resize #define pb push_back #define mkp make_pair #define debug(...) fprintf (stderr, __VA_ARGS__) #define Lep(i, l, r) for (int i = l; i < ...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
b92cbe0cac0a5f11effec27f60a042d5
2,900
PASSED
# include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double doubl; typedef pair<ll,ll> pii; //typedef pair<ll,ll> pll; #define re register #define mk make_pair const ll nr = 6e5+100; inline ll read() { ll ret = 0;ll x = 1;char ch = getc...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
f7e28fa93ddaf35d1c056f957b975974
2,900
PASSED
# include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double doubl; typedef pair<ll,ll> pii; //typedef pair<ll,ll> pll; #define re register #define mk make_pair const ll nr = 6e5+100; inline ll read() { ll ret = 0;ll x = 1;char ch = getc...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
3221189ba249103cd09f3ae574eff0fd
2,900
PASSED
# include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double doubl; typedef pair<ll,ll> pii; //typedef pair<ll,ll> pll; #define re register #define mk make_pair const ll nr = 6e5+100; inline ll read() { ll ret = 0;ll x = 1;char ch = getc...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
c9b26b7ed94801601f5159115c8ab7ae
2,900
PASSED
# include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double doubl; typedef pair<ll,ll> pii; //typedef pair<ll,ll> pll; #define re register #define mk make_pair const ll nr = 6e5+100; inline ll read() { ll ret = 0;ll x = 1;char ch = getc...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
e69b161cccfa8cb1891bc7aa786bce12
2,900
PASSED
//Challenge: Accepted #include <iostream> #include <algorithm> #include <vector> #include <utility> #include <bitset> #include <deque> #include <stack> using namespace std; void debug(){cout << endl;}; template<class T, class ...U> void debug(T a, U ... b){cout << a << " ", debug(b ...);}; template<class T> ...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
d3d97544a3da9ea405413fa942895137
2,900
PASSED
// LUOGU_RID: 95275123 #include<bits/stdc++.h> #define reg register #define int long long using namespace std; inline int read(){ reg int k=1,x=0;char ch=getchar(); while (ch<'0'||ch>'9'){if(ch=='-') k=-1;ch=getchar();} while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-48,ch=getchar(); return k*x; } inline int ...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
9a78087a8997fb4efa5d621814fef461
2,900
PASSED
// LUOGU_RID: 95274639 #include<bits/stdc++.h> #define reg register #define ll long long #define pii pair<int,int> #define mp make_pair #define pb push_back #define se second using namespace std; namespace fastio { #define FILE_SIZE 1 << 23 char rbuf[FILE_SIZE], *p1 = rbuf, *p2 = rbuf, wbuf[FILE_SIZE], *p3 ...
C++
670ea05f88a6b31ea0c96ccebdbee2cd
80859e29113b4579dd0cc4f7c53e61c7
2,900
PASSED
// Hydro submission #62e1f8577683121d2c1d6f66@1658976344013 #include<bits/stdc++.h> using namespace std; #define ll long long #define N 1000100 const ll Mod=998244353; int T,n,k,v[N]; int main() { scanf("%d",&T); while(T--) { scanf("%d%d",&n,&k); for(int i=1;i<=n;i++) scanf("%d",&v[i]); bool ok=0; ...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
0dcd735cf9f37f02be748a75523d29a2
2,500
PASSED
// Hydro submission #62d950b07683121d2c1adacc@1658409136509 #include<bits/stdc++.h> using namespace std; const int N=1e6+5,MOD=998244353; int a[N]; int main(){ int t,n,k; cin>>t; while(t--){ int ans=1,op=0; cin>>n>>k; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]>=i){ cout<<"0\n";op=1; ...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
0656d956768e84dce0197358cf77c332
2,500
PASSED
// Hydro submission #62d94a577683121d2c1ad79d@1658407511848 #include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') f = -f; c = getchar();} while (c >= '0' && c <= '9') {x = x * 10 + (c ^ 48); c = getchar();} return x * ...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
683aa55667cff47f745bb956c5df0398
2,500
PASSED
// Hydro submission #62d9338b7683121d2c1ac8ea@1658401676770 #include<bits/stdc++.h> #define ll long long #define ff(i,s,e) for(int i(s);i<=(e);++i) using namespace std; inline int read(){ int x=0,f=1; char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<1)+(...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
22cdc3e589f288bca1d33e0acc4249c3
2,500
PASSED
// Hydro submission #62d92e8f7683121d2c1ac57f@1658400400765 #include<bits/stdc++.h> #define int long long using namespace std; const int inf=2147483647; inline int rd(){ int s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();} while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=getch...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
378ede62780688d303c402791d47e754
2,500
PASSED
// Hydro submission #62d910827683121d2c1aa4ac@1658392707452 #include<bits/stdc++.h> using namespace std; const int mod=998244353; const int N=1e6+7; int T,n,k,a[N]; inline void solve(){ scanf("%d%d",&n,&k); long long ans=1; for(int i=1;i<=n;i++){ scanf("%d",&a[i]); int x,y=(i+k-1)%n; if(a[i]==...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
7a4b33a9324a93917c2d70d79958add4
2,500
PASSED
// Hydro submission #62d8fbcb7683121d2c1a7052@1658387404764 #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<vector> #include<iostream> #include<queue> #define ll long long #define int ll using namespace std; const int N=2e6+10,mod=998244353; inline int read(){ int d=0,f=1;ch...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
64265a91eeebd23b0741a5a9fdc9f860
2,500
PASSED
// Hydro submission #62d8e9637683121d2c1a4f5f@1658382691808 #include <bits/stdc++.h> using namespace std; const int maxn=1e6+10,mod=998244353; int T,n,v[maxn],k; int main() { scanf("%d",&T); while(T--) { scanf("%d%d",&n,&k); for(int i=1;i<=n;i++) scanf("%d",&v[i]); bool flag=0; for(int i=n-k+...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
a0ac78f98c6cb0e9bbeb79554c73c6ad
2,500
PASSED
// Hydro submission #62d8e91e7683121d2c1a4e95@1658382623261 #include <bits/stdc++.h> #define N 1000010 #define M 998244353 using namespace std; typedef long long ll; int T; int n, k; int v[N]; ll ans; int main() { cin >> T; while (T--) { ans = 1; cin >> n >> k; for (int...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
f87146dd5a1218b6b5445c8bef0538be
2,500
PASSED
// Hydro submission #62d8c1737683121d2c1a45ab@1658372473259 /* p_b_p_b txdy AThousandMoon txdy AThousandSuns txdy hxy txdy */ #include <bits/stdc++.h> #define pb push_back #define fst first #define scd second using namespace std; typedef long long ll; typedef pair<ll, ll> pii; const int maxn = 10...
C++
f2b2d12ab1c8a511d2ca550faa9768d4
d89e0c00a8a55f831cf3495716671296
2,500
PASSED
/**So..a**/ #include<bits/stdc++.h> //#include<iostream> using namespace std; //#include<ext/pb_ds/tree_policy.hpp> //#include<ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; //template<typename temp> //using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistic...
C++
4bcaa910cce687f0881a36231aa1a2c8
75be9f732a2ae109fa72139edad68f73
1,900
PASSED
/**So..a**/ #include<bits/stdc++.h> //#include<iostream> using namespace std; //#include<ext/pb_ds/tree_policy.hpp> //#include<ext/pb_ds/assoc_container.hpp> //using namespace __gnu_pbds; //template<typename temp> //using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistic...
C++
4bcaa910cce687f0881a36231aa1a2c8
dead488bffb3e0bcf3d50d44157f5820
1,900
PASSED
#include <iostream> #include <bits/stdc++.h> using namespace std; void cmain() { int n; cin >> n; int a[n]; for (int i=0;i<n;i++){ cin >> a[i]; } int b[n]; for (int i=0;i<n;i++){ cin >> b[i]; } map<int,int> t; for (int i=0;i<n;i++){ t[b[i]]...
C++
4bcaa910cce687f0881a36231aa1a2c8
674748ec3a7bd5a5577f30b5c7b75b79
1,900
PASSED
#include<bits/stdc++.h> #define reg register #define IL inline using namespace std; char _B[1<<15],*_S=_B,*_T=_B; #define getchar() (_S==_T&&(_T=(_S=_B)+fread(_B,1,1<<15,stdin),_S==_T)?EOF:*_S++) IL int read(){ reg int x=0,f=1;reg char c=getchar(); for(;!isdigit(c);c=getchar())if(c=='-')f=-1; for(;isdigit(c...
C++
4bcaa910cce687f0881a36231aa1a2c8
1e39358fbc3eab61b3e2ad50f2e6a2ba
1,900
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O2,unroll-loops") #define fio ios_base::sync_with_stdio(0);cin.tie(0); #define ll long long #define en cin.close();return 0; #define INF (int)(1e9) #define pb push_back #define fi first//printf("%lli\n",cur); #define se second//scanf("%lli",&n); #define r0 return...
C++
4bcaa910cce687f0881a36231aa1a2c8
de5f83c0879457f5e884e373d3b29db3
1,900
PASSED
#include<bits/stdc++.h> using namespace std; const int N=1e5+10; typedef long long ll; int n,a[N],b[N]; int ida[N],idb[N]; bool bl[N]; int main() { int tc; scanf("%d",&tc); while(tc--) { scanf("%d",&n); for(int i=1;i<=n;i++) { bl[i]=0; sca...
C++
4bcaa910cce687f0881a36231aa1a2c8
eaeb20bc13e645887fc8db959dee04cb
1,900
PASSED
#include <stdio.h> #define ll long long int fa[100010],si[100010],A[100010],B[100010]; int getv(int x){return x==fa[x]?x:fa[x]=getv(fa[x]);} void merge(int x,int y){fa[getv(x)]=getv(y);} int main() { int T; scanf("%d",&T); while(T--) { int n,m=0;scanf("%d",&n);ll ans=0; for(int i=1;i<=n;...
C++
4bcaa910cce687f0881a36231aa1a2c8
93a4b7fad926f8a6a21996316e15868b
1,900
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL) #define testcase int T; cin >> T; for (int tc = 1; tc <= T; tc++) #define MAX 1000000007 #define Limit 1000000000 #define modulo 998244353 #define INF 4000000000000000005 #defi...
C++
4bcaa910cce687f0881a36231aa1a2c8
be7139c5952ec6528a9e86401a5635ea
1,900
PASSED
/*-----author : chaser------*/ #include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f #define ll long long #define pii pair<int,int> #define fi first #define se second #define pb push_back #define po pop_back const int N = 1e6+5, mod = 1e9+7; int n,m; vector<int>g[N]; bool st[N]; int res=...
C++
4bcaa910cce687f0881a36231aa1a2c8
621ff4ebfe81c0fe38f034d9452d09bb
1,900
PASSED
/*-----author : chaser------*/ #include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f #define ll long long #define pii pair<int,int> #define fi first #define se second #define pb push_back #define po pop_back const int N = 1e6+5, mod = 1e9+7; int n,m; vector<int>g[N]; bool st[N]; int res=...
C++
4bcaa910cce687f0881a36231aa1a2c8
d24891d178578cb45b218559025360d5
1,900
PASSED
#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]; } vector<vector<int>> b_dp(n + 1, vector<int> (n + 1, 0)); vector<vector<int>> c_dp(n + 1, vector<int> (n + 1, 0)); for (int b = 0; ...
C++
d6a123dab1263b0e7b297ca2584fe701
45b4312e7fd686f57a0a9b095121eb49
1,600
PASSED
#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]; } vector<vector<int>> b_dp(n + 1, vector<int> (n + 1, 0)); vector<vector<int>> c_dp(n + 1, vector<int> (n + 1, 0)); for (int b = 0; ...
C++
d6a123dab1263b0e7b297ca2584fe701
f578ee5b6d2563fb941ab022149fef46
1,600
PASSED
#include <bits/stdc++.h> using namespace std; // #define int long long int b_dp[5001][5001], c_dp[5001][5001]; int a[5001]; void solve() { int n; cin >> n; for (int i = 0; i < n; i++) { a[i] = b_dp[i][n - 1] = c_dp[i][0] = 0; } for (int i = 0; i < n; i++) { cin >> a[i]; } for (int b = 0; b < ...
C++
d6a123dab1263b0e7b297ca2584fe701
e97f27c10c49d83006d5805472914107
1,600
PASSED
#include<bits/stdc++.h> using namespace std; int dp1[5001][5001]; int dp2[5001][5001]; int main() { int t; cin >> t; int per[5001]; while (t--) { int n; cin >> n; for (int i = 0; i < n; i++) { per[i] = dp1[i][n - 1] = dp2[i][0] = 0; } ...
C++
d6a123dab1263b0e7b297ca2584fe701
9de68edfedef25e90c5ca44cb7938979
1,600
PASSED
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL) #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> orde...
C++
d6a123dab1263b0e7b297ca2584fe701
2a2444abcd040f06e305d29a55296ccd
1,600
PASSED
#include<bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; // using namespace __gnu_pbds; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define MOD 1000000007 #define MOD1 998244353 ...
C++
d6a123dab1263b0e7b297ca2584fe701
de76ace4ce650a54b0ca04a74b8259e7
1,600
PASSED
// a b c d // c>a b>d // we can use n^2 app // 5000*5000 = 2.5 * 10^7 // 1 2 3 4 5 6 67 #include<bits/stdc++.h> using namespace std; int br[5001][5001]; // stores number of elem that are less in front int cr[5001][5001];// stores number of elem that are less in back int main() { int ...
C++
d6a123dab1263b0e7b297ca2584fe701
61d8913595f1d6065426e769e541ff04
1,600
PASSED
/* ANIKET ASH */ #include<bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; // using namespace __gnu_pbds; #define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define int long long int #define pb pu...
C++
d6a123dab1263b0e7b297ca2584fe701
d88376ab9f50c480fb38f6f0a17fc045
1,600
PASSED
/* ANIKET ASH */ #include<bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; // using namespace __gnu_pbds; #define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define int long long int #define pb pu...
C++
d6a123dab1263b0e7b297ca2584fe701
07216cd6635e5b270bb6ecabe530b1d0
1,600
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double lld; #define INF 1e18 #define MOD 1000000007 #define nline "\n" #define pb push_back #define ppb pop_back #define mp make_pair #define ff first #define ss second #define PI 3.141592...
C++
d6a123dab1263b0e7b297ca2584fe701
7cfdef10fda20110019d0eda09addfcd
1,600
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
0df54bcd33e905f3aa170e7d1fba2357
2,900
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
56a694dbe810a9939090d8c3ddb86c3d
2,900
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
66ba9b1b2b7720388feb2070c8df453b
2,900
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
3fc98d95a21dd697c1a56524f2d3da29
2,900
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
d6b36e4cf754022cc56e0b91f958d8c7
2,900
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
5c67e13cc993b413e2a1574cc266bf39
2,900
PASSED
#include<bits/stdc++.h> #define ls i<<1 #define rs i<<1|1 #define fi first #define se second #define min amin #define max amax #define pb push_back using namespace std; using ll=long long; using pii=array<int,2>; const int N=2E5+10; const int inf=1E9; template<typename T=int>T read(){T x;cin>>x;return x;} ...
C++
5f20b34bca30c9889c32540687c68db5
d842c968a3084f7e2a375f246bdd85d1
2,900
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; const int inf = 1e9+10; const ll inf_ll = 1e18+10; #define all(x) (x).begin(), (x).end() #define pb push_back #define cmax(x, y) (x = max(x, y)) #define cmin(x, y) (x = min(x, y)) #ifndef LOCAL #define debug(...) 0 #else #include "../.....
C++
5f20b34bca30c9889c32540687c68db5
9d2efa324da7f25ed5ec0390fd61d24a
2,900
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long int; template<typename T> ostream& operator+(ostream& out, const vector<T> &vec){ for(const auto &x : vec){ out<<x<<" "; } out<<"\n"; return out; } template<typename T> ostream& operator*(ostream& out, const vector<T>...
C++
5f20b34bca30c9889c32540687c68db5
98dd52682c35c9d18205bf4e16bf563c
2,900
PASSED
//I wrote this code 4 u today #include <bits/stdc++.h> char mem[(int)4e8]; size_t cur = 0; void *operator new(size_t n) { return mem + (cur += n) - n; } void operator delete(void *) {} namespace IO { const int DPAIRSIZ = 1 << 18; char BB[DPAIRSIZ], *SS = BB, *TT = BB; inline char ...
C++
5f20b34bca30c9889c32540687c68db5
0316da09b582b23ef2ead603825aabec
2,900
PASSED
#include<bits/stdc++.h> using namespace std; int row[2000005]; string s; int main(){ int T,n,m,t; scanf("%d",&T); while(T--){ scanf("%d %d",&n,&m); cin>>s; for (int i = 0; i <= m; i++)row[i] = false; int dp[n + 1][m + 1]; memset(dp, 0, sizeof dp); int idx=0; for(int i=1;i<=n;i++){ fo...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
21d510c9ca81b27cefbe50e3cea609f1
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int row[2000005]; string s; int main(){ int T,n,m,t; scanf("%d",&T); while(T--){ scanf("%d %d",&n,&m); cin>>s; for (int i = 0; i <= m; i++)row[i] = false; int dp[n + 1][m + 1]; memset(dp, 0, sizeof dp); int idx=0; for(int i=1;i<=n;i++){ fo...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
f8ed901514cce047c37489ef328f84fa
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int row[2000005]; string s; int main(){ int T,n,m,t; scanf("%d",&T); while(T--){ scanf("%d %d",&n,&m); cin>>s; for (int i = 0; i <= m; i++)row[i] = false; int dp[n + 1][m + 1]; memset(dp, 0, sizeof dp); int idx=0; for(int i=1;i<=n;i++){ fo...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
77dc33081320da3d6eb9d5c5e3bac8f1
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int row[2000005]; string s; int main(){ int T,n,m,t; scanf("%d",&T); while(T--){ scanf("%d %d",&n,&m); cin>>s; for (int i = 0; i <= m; i++)row[i] = false; int dp[n + 1][m + 1]; memset(dp, 0, sizeof dp); int idx=0; for(int i = 1;i <= n; i++) ...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
054af60f97ae698be8359290971d494b
1,700
PASSED
#include<bits/stdc++.h> using namespace std; #define print(t) cout<<"Case #"<<t<<": " #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define pi 3.14159265359 #define endl "\n" #define ms(a,x) memset(a,x,sizeof(a)) #define memo(n,type,start) vector<type>memo(n,start) #define vll(v,n) vector<...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
80dc53da76774e9aa2b3800fdb9f7eda
1,700
PASSED
// #include<bits/stdc++.h> // using namespace std; // #define print(t) cout<<"Case #"<<t<<": " // #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) // #define pi 3.14159265359 // #define endl "\n" // #define ms(a,x) memset(a,x,sizeof(a)) // #define memo(n,type,start) vector<type>memo(n,start) ...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
59b4e10d0880f203fe3c1c2655615169
1,700
PASSED
#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> using namespace std; const int N = 1e6+5; int t, n, m, ans; int row[N], col[N]; char str[N]; int main(){ scanf("%d", &t); while(t--){ for(int i = 1; i <= m; i++) col[i] = 0, row[i] = 0; scanf("%d%d%s", &n, &m, str+1);...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
0c94ed57cd3b4f45d9261f43e180d26e
1,700
PASSED
#include<bits/stdc++.h> using namespace std; #define N 1000010 int n, m, l[N], h[N]; char a[N]; int main() { int T; scanf("%d",&T); while(T--) { scanf("%d%d%s",&n,&m,a+1); for(int i=0;i<=n*m+5;i++) h[i]=0, l[i]=0; int lst=-1; for(int i=1;i<=n*m;i++) { if(a[i]=='1') lst=m; if(i>m) h[i]=h...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
3096b8668d8f576684b5339a8872f41a
1,700
PASSED
#include<bits/stdc++.h> using namespace std; #define N 1000010 int n, m, l[N], h[N]; char a[N]; int main() { int T; scanf("%d",&T); while(T--) { scanf("%d%d%s",&n,&m,a+1); // memset(l,0,sizeof(l)); // memset(h,0,sizeof(h)); for(int i=0;i<=n*m+5;i++) h[i]=0, l[i]=0; int lst=-1; for(int i=1;i...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
f0d04412276ddf1f035680cfc64eb66a
1,700
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long int lli; typedef long long ll; typedef long long ll; typedef long double ld; typedef vector<lli> vlli; typedef vector<ll>vll; typedef vector<int> vi; typedef vector<ld> vld; typedef vector<string> vs; typedef vector<vector<lli>> vvlli; typ...
C++
ca835eeb8f24de8860d6f5ac6c0af55d
fdf132df08832e8525b62edd83d023fb
1,700
PASSED
#include<bits/stdc++.h> //#pragma GCC optimize(2) #define Low(x) pow(2,(int)(log(x-0.1)/log(2))+1) using namespace std; const int N=1e5+100,maxn=1e5; int fl[N],nf[N]; typedef long long ll; const int mod=998244353,o=3; int mi(int x,int t){ int d=1; while(t){ if(t%2) d=(ll)d*x%mod; x=(ll)x*x%mod;t/=...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
98d03a008a18ab5f93d0b9b77b68a32a
3,500
PASSED
#include<bits/stdc++.h> //#pragma GCC optimize(2) #define Low(x) pow(2,(int)(log(x-0.1)/log(2))+1) using namespace std; const int N=1e5+100,maxn=1e5; int fl[N],nf[N]; typedef long long ll; const int mod=998244353,o=3; int mi(int x,int t){ int d=1; while(t){ if(t%2) d=(ll)d*x%mod; x=(ll)x*x%mod;t/=...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
c8ce0aa405e1c3d067a820cd14862841
3,500
PASSED
#include <cstdio> #include <vector> #include <time.h> #include <iostream> #include <algorithm> using namespace std; #define rep(i, l, r) for (int i = l; i <= r; ++i) #define dep(i, l, r) for (int i = r; i >= l; --i) const int N = 265000 + 5, M = 20; const int Mod = 998244353; int n, m, p, ans, s[N], v[N], fa...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
43782e7e529fc8c0da70829e0b9a1169
3,500
PASSED
#include <cstdio> #include <vector> #include <time.h> #include <iostream> #include <algorithm> using namespace std; #define rep(i, l, r) for (int i = l; i <= r; ++i) #define dep(i, l, r) for (int i = r; i >= l; --i) const int N = 265000 + 5, M = 20; const int Mod = 998244353; int n, m, p, ans, s[N], v[N], fa...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
ff4d5db8583b01236ad569faa9171452
3,500
PASSED
#include <cstdio> #include <vector> #include <time.h> #include <iostream> #include <algorithm> using namespace std; #define rep(i, l, r) for (int i = l; i <= r; ++i) #define dep(i, l, r) for (int i = r; i >= l; --i) const int N = 265000 + 5; const int Mod = 998244353; int n, m, p, ans, s[N], v[N], fac[N], in...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
054117da4d32dd15511cd1796ed22cdd
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; void ADD(int &x, int y) { x += y; if (x >= mod) x -= mod; } void SUB(int &x, int y) { x -= y; if (x < 0) x += mod; } long long power(long long a, int b) { long long ans = 1; while (b) { if (b & 1) ans = ans * a % mo...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
f1a5c433e0d03e22754f0c010857e001
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int mod = 998244353; void ADD(int &x, int y) { x += y; if (x >= mod) x -= mod; } void SUB(int &x, int y) { x -= y; if (x < 0) x += mod; } long long power(long long a, int b) { long long ans = 1; while (b) { if (b & 1) ans = ans * a % mo...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
d20d3a7db7559952280e0908a403d132
3,500
PASSED
// LUOGU_RID: 95088803 #include<bits/stdc++.h> using namespace std; #define F(i,a,b) for(int i=a;i<=b;i++) #define Fd(i,a,b) for(int i=a;i>=b;i--) #define N 600010 #define mo 998244353 #define LL long long #define ULL unsigned long long #define ls x<<1 #define rs (x<<1)|1 int rev[N],G1[N],G2[N],fac[N],ifac[...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
d2eb2c54c043c9b1e190c69b50662850
3,500
PASSED
// LUOGU_RID: 94469787 #include <cstdio> #include <vector> #include <algorithm> #define rep( i, a, b ) for( int i = (a) ; i <= (b) ; i ++ ) #define per( i, a, b ) for( int i = (a) ; i >= (b) ; i -- ) const int mod = 998244353; const int MAXN = ( 1 << 18 ) + 5; template<typename _T> inline void Read( _T &x ) { x = 0...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
aebf8b0a28a7e64994fdac2ab23cf008
3,500
PASSED
#include <bits/stdc++.h> using ll = long long; using namespace std; const int mod = 998244353, G = 3; int norm(int x) { return x >= mod ? x - mod : x; } int reduce(int x) { return x < 0 ? x + mod : x; } int neg(int x) { return x ? mod - x : 0; } void add(int &x, int y) { if ((x += y - mod) < 0) x += mod; }...
C++
4daf6f4b98abcdeb2f5ef6cc5241ba9e
d2470c6d8707f9a69244eab37dc46aa7
3,500
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define mod (1e9 + 7) #define inf 1e18 #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define w(x) int x; cin >> x; while(x--) mt19937 rng...
C++
87302bcc6c8f239641ab6f6dbeeae09c
cfd9ba2e59fd0d3af92fa2bc738db87e
1,400
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define mod (1e9 + 7) #define inf 1e18 #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define w(x) int x; cin >> x; while(x--) mt19937 rng...
C++
87302bcc6c8f239641ab6f6dbeeae09c
7ac3c59ef3627a2a85e38abc2ca6ed6e
1,400
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define mod (1e9 + 7) #define inf 1e18 #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define w(x) int x; cin >> x; while(x--) mt19937 rng...
C++
87302bcc6c8f239641ab6f6dbeeae09c
ae18d5ee811d70ccd614348f264a96af
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(...
C++
87302bcc6c8f239641ab6f6dbeeae09c
37dfc1591b5bd8a8b9ef2007c0d38bb0
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" const double PI=3.14159265358979323846264338327950288419716939937510582097494459230; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __pri...
C++
87302bcc6c8f239641ab6f6dbeeae09c
1ad0403ca8a96c380d928ac78f8ef0c3
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" const double PI=3.14159265358979323846264338327950288419716939937510582097494459230; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __pri...
C++
87302bcc6c8f239641ab6f6dbeeae09c
0a250a9eb32b9e16f01e0d57b2a3d728
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" const double PI=3.14159265358979323846264338327950288419716939937510582097494459230; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __pri...
C++
87302bcc6c8f239641ab6f6dbeeae09c
c97b057b0513df10e46f23e9c620e08a
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" const double PI=3.14159265358979323846264338327950288419716939937510582097494459230; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __pri...
C++
87302bcc6c8f239641ab6f6dbeeae09c
b83e97426057c9949176c99f494317e5
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(c) c.begin(), c.end() #define endl "\n" const double PI=3.14159265358979323846264338327950288419716939937510582097494459230; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __pri...
C++
87302bcc6c8f239641ab6f6dbeeae09c
7321a5a8fc4a3ea4fcb3b3397d9357bb
1,400
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5+10; int a[N],b[N]; int n, m; bool check(int x){ ll cnt = 0, cnt2 = 0; for(int i = 1; i <= n; i++ ){ if(b[i]<x) cnt += abs(b[i]-x)/2; else cnt2 += abs(b[i]-x); } if(cnt<cnt2) return false; ...
C++
87302bcc6c8f239641ab6f6dbeeae09c
b5f00a98a392440c76b60f9a440f231b
1,400
PASSED
/************ @Author tarunguptaraja-quirkyAlone @Quote Coding is under my rule. ************/ import java.io.*; import java.util.*; public class Main { public static void main(String[] params) throws IOException { InputReader in = new InputReader(System.in); OutputWriter out = ...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
75f1abf49b7503a0bd41ebda271a6430
800
PASSED
/************ @Author tarunguptaraja-quirkyAlone @Quote Coding is under my rule. ************/ import java.io.*; import java.util.*; public class Main { public static void main(String[] params) throws IOException { InputReader in = new InputReader(System.in); OutputWriter out = ...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
3e22ed648e31a410b558ee2a9fff90cc
800
PASSED
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class D { static short m_short = Short.MAX_VALUE; static Scanner sc= new Scanner(System.in); public static voi...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
64060f4cf5a7b5dcda48c05c466f56cc
800
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; public class Solution{ public static void main(String[] args){ FastScanner in = new FastScanner(); int t = in.nextInt(); ...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
6a4f0869a7c03fc3c7065d732cd46d82
800
PASSED
import java.util.*; public class main { public static void main(String[] strgs) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-- >0) { int n=sc.nextInt(); boolean[] vis=new boolean[n+1]; System.out.println(2); for(int i=1;i<=n;i++) { int var=i; if(vis[i]==true)...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
ffbca98b769f1d1ad80f03532db51a3e
800
PASSED
/* * author:traveller * way to red */ import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.*; public class Permutation { public static void main(String AC[]) ...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
f12846d95a3343592f30503798cf8917
800
PASSED
import java.util.*; import java.io.*; public class Main { static long mod = 1000000007; static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void main(String[] args) throws IOException { FastReader sc = new FastReader(); int t = sc.nextInt(); while( t-- ...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
b1d1e70108c4cdebab6a2c0691adc2fe
800
PASSED
import java.util.ArrayList;; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; public class Permutation { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private in...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
b40af80a6d1e85259bb017c6f720e64a
800
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static int globalVariable = 123456789; static String author = "pl728 on codeforces"; // 1 2 4 8 16 ... // 3 6 12 24 48 // next unseen public static void main(Stri...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
38a24233c0f2c64d8c62ce10a0989fc9
800
PASSED
import java.io.*; import java.util.*; import java.math.BigInteger; import static java.lang.Math.min; import static java.lang.Math.max; import static java.lang.Math.abs; public class CodeForces { static int mod=1000000000+7; static FastScanner in=new FastScanner(); static PrintWriter out=new PrintWriter(...
Java
3b9380ca571dbf3e24fc1b1c8b91790b
2dc59b713933624ca2042471c17f1c31
800
PASSED
#include <bits/stdc++.h> using namespace std; //Function that compares and order two pairs, returning that one is higher than the other. auto order = [](pair<int, int> one, pair<int, int> two) {return one.first > two.first;}; int main() { int t; cin >> t; vector<vector<int>> permutaciones(t, vector<int>(...
C++
5481863fd03c37cdcb7d6ee40f973cb9
3fc4334d3b31d0e0cb8b6e23d474da1e
1,900
PASSED