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
// Problem: E. AND-MEX Walk // Contest: Codeforces Round #782 (Div. 2) // URL: https://codeforces.com/contest/1659/problem/E // Memory Limit: 256 MB // Time Limit: 3000 ms // Create Time : 2022-04-24 20:30:08 // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> #define all(x) x.begin()...
C++
a3e89153f98c139d7e84f2307b128b24
91d52561d7f1f776aad9898e20992a7e
2,200
PASSED
// Problem: E. AND-MEX Walk // Contest: Codeforces Round #782 (Div. 2) // URL: https://codeforces.com/contest/1659/problem/E // Memory Limit: 256 MB // Time Limit: 3000 ms // Create Time : 2022-04-24 20:30:08 // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> #define all(x) x.begin()...
C++
a3e89153f98c139d7e84f2307b128b24
6145436307e078539c31710482c4b8ca
2,200
PASSED
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <math.h> #include <string.h> using namespace std; using std::cout; using std::cin; typedef long long ll; typedef long double ld; typedef double db; typedef string str; typedef pair<int,int> pi; typedef pair<ll,ll> pl; ty...
C++
a3e89153f98c139d7e84f2307b128b24
732f38456e963b1798c7605b56aca0d0
2,200
PASSED
#include<bits/stdc++.h> using namespace std; const int N =1e5+5; int fa[32][N]; int vis[32][N]; struct Node{ int u,v,w; }; vector<Node> ve; int find(int i,int x){ int t ,fx; t = x; while(fa[i][x]!=x){ x = fa[i][x]; } fx = x; x = t; while(x!=fx){ t = fa[i][x]; fa[i][x] = fx; x =...
C++
a3e89153f98c139d7e84f2307b128b24
d28890f2ef6ba40a885b2e4a3839a469
2,200
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 1e5+5; int fa[32][N]; int vis[32][N]; struct edge{ int u,v,w; }; vector<edge> e; int find(int i,int x){ int t ,fx; t = x; while(fa[i][x]!=x){ x = fa[i][x]; } fx = x; x = t; while(x!=fx){ t = fa[i][x]; fa[i][x] = fx; x...
C++
a3e89153f98c139d7e84f2307b128b24
dd22104547d854baf277703679ed55af
2,200
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 1e5+5; int fa[32][N]; int vis[32][N]; struct edge{ int u,v,w; }; vector<edge> e; int find(int i,int x){ int t ,fx; t = x; while(fa[i][x]!=x){ x = fa[i][x]; } fx = x; x = t; while(x!=fx){ t = fa[i][x]; fa[i][x] = fx; x...
C++
a3e89153f98c139d7e84f2307b128b24
de47fa509980f0ed581021da7901c0e7
2,200
PASSED
#include <cstdio> #include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <cmath> #include <sstream> using namespace std; typedef pair<int,int> Pair; const int Dir[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; template<class t> ostream & operator << (ostream & tout,const vect...
C++
a3e89153f98c139d7e84f2307b128b24
64e9460cbd225bd1c52d84fd7a4a684e
2,200
PASSED
#include <bits/stdc++.h> #define int long long #define ii pair<int,int> #define F first #define S second using namespace std; const int N=2e5+100; const int L=31; int p[N][L]; int si[N][L]; set<int> st[L]; vector<int> vec; int find(int v,int u) { if(v==p[v][u])return v; return p[v][u]=find(p[...
C++
a3e89153f98c139d7e84f2307b128b24
e8a53fc053eac63bc4ea4e7c0b094773
2,200
PASSED
#include<bits/stdc++.h> #define maxn 100005 using namespace std; int n,m,q; int fa[maxn][35],p[maxn],sum[maxn],ss[maxn]; struct edge{int x,y,v;}e[maxn]; int find(int x,int k){return fa[x][k]==x?x:fa[x][k]=find(fa[x][k],k);} bool check0(int x,int y){ for(int i=0;i<=30;i++) if(find(x,i)==find(y,i)) return true; ...
C++
a3e89153f98c139d7e84f2307b128b24
509e911b5faecbb5933d09f1409b3d2c
2,200
PASSED
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <functional> using namespace std; void solve(int test_ind){ int n, x; cin >> n >> x; x--; vector<vector<int> > g(n); for (int i=1;i<n;++i){ int a, b; scanf("%d%d", &a, &b); a--;b--; g[a].pu...
C++
245eff3c470b41c3fe2affd06b1653b4
9832404063d151054d3cd3adf93dba9f
3,000
PASSED
#include <bits/stdc++.h> #define X first #define Y second using namespace std; //#define endl '\n' typedef long long LL; const int MX = 200005; int n, x, sz[MX], p[MX]; vector <int> con[MX]; bool check(){ for(int i = 0; i < n; i++) if(p[i] != i) return 0; return 1; } int vis[MX]; int main(...
C++
245eff3c470b41c3fe2affd06b1653b4
f8306cddf860fab9500acc73547a8af4
3,000
PASSED
#include<iostream> #include<cstdio> using namespace std; int t,n,m,d[200001],p[200001],cnt,node; bool vis[200001]; inline int read() { int x=0; char c=getchar(); while(c<'0'||c>'9') c=getchar(); while(c>='0'&&c<='9') { x=(x<<1)+(x<<3)+(c^48); c=getchar(); }...
C++
245eff3c470b41c3fe2affd06b1653b4
ef37ae1d1c6e1b648d54119ab615563f
3,000
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define inf 0x3f3f3f3f #define mod 1000000007 typedef pair<int,int> pir; string sstr[]={"Bob\n","Alice\n"}; const int N=200010; int T,n,x; vector<int> vec[N]; int dp[N],deg[N];//标记每个点往其父亲的边是奇数边还是偶数边 int len; int a[N],vis[N]; void dfs(int ...
C++
245eff3c470b41c3fe2affd06b1653b4
92fca94e480adba717dd77c62c597f9f
3,000
PASSED
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC target("avx2") #define int long long #define MAXN 200100 int n,mk; vector<int>adj[MAXN]; int arr[MAXN]; vector<int>incorrect; vector<vector<int>>cycles; vector<bool>visited; pair<int,int>dfs(int node,int par){//includ...
C++
245eff3c470b41c3fe2affd06b1653b4
eea25e4dfb8681a45d54169b38ee374c
3,000
PASSED
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC target("avx2") #define int long long #define MAXN 200100 int n,mk; vector<int>adj[MAXN]; int arr[MAXN]; vector<int>incorrect; vector<vector<int>>cycles; vector<bool>visited; pair<int,int>dfs(int node,int par){//includ...
C++
245eff3c470b41c3fe2affd06b1653b4
0fb5ed96eda67ccadcf28740da9ac3eb
3,000
PASSED
/* * File created on 04/18/2022 at 15:35:39. * Link to problem: * Description: * Time complexity: O() * Space complexity: O() * Status: --- * Copyright: Ⓒ 2022 Francois Vogel */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <funct...
C++
245eff3c470b41c3fe2affd06b1653b4
6bbf24fca481f19b3bf9c6dd5062b684
3,000
PASSED
/* * File created on 04/18/2022 at 15:35:39. * Link to problem: * Description: * Time complexity: O() * Space complexity: O() * Status: --- * Copyright: Ⓒ 2022 Francois Vogel */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <funct...
C++
245eff3c470b41c3fe2affd06b1653b4
671302a3d14cdd5c73d092f616ace57b
3,000
PASSED
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<unordered_map> #include<vector> #include<numeric> #include<cmath> using namespace std; #define ll long long #define ge getchar #define pun putchar('\n') #define pu putchar #define puk putchar(' ') #define pb push_back con...
C++
245eff3c470b41c3fe2affd06b1653b4
36455b2376334c7eb1458771b3fad8d0
3,000
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; char gc(){static char buf[1<<16],*s,*t;if(s==t){t=(s=buf)+fread(buf,1,1<<16,stdin);if(s==t)return EOF;}return *s++;} //#define getchar gc ll read() { char c; ll w=1; while((c=getchar())>'9'||c<'0')if(c=='-')w=-1; ll ans=c-'0'; while((c=ge...
C++
245eff3c470b41c3fe2affd06b1653b4
42c58e1baadefe06f93c7527ac6848ae
3,000
PASSED
#include <bits/stdc++.h> using namespace std; bool condition(vector<long long int> &a, long long int len) { long long int i = 1, sum1 = a[0], sum2 = 0; int mid = len / 2 + 1; while (i <= mid) { if(i == len-i){ break; } sum1 += a[i]; sum2 += a[len - i]; if (su...
C++
4af59df1bc56ca8eb5913c2e57905922
c494aca92989171d827e370382bac008
800
PASSED
#include <bits/stdc++.h> using namespace std; long long pref[200005], suff[200005]; int main() { cin.sync_with_stdio(0), cin.tie(0); int t, n, arr[200005], blue, red; bool ch; cin >> t; while (t--) { ch = false; cin >> n; red = n, blue = 2; for (int i = 1; i...
C++
4af59df1bc56ca8eb5913c2e57905922
358cad9db2cd2a1f109dbf890d5588ff
800
PASSED
#include <bits/stdc++.h> #define int long long #define endl '\n' using namespace std; #define not_less_than(v, n) lower_bound(v.begin(), v.end(), n) // n >= #define not_more_than(v, n) lower_bound(v.rbegin(), v.rend(), n, greater<int>()) // n <= #define more_than(v, n) upper_bound(v.begin(), v.end(),...
C++
4af59df1bc56ca8eb5913c2e57905922
8fa4bca49e024fa5a7179f3355023d7a
800
PASSED
/** حَسْبِيَ اللَّهُ لا إِلَـهَ إِلاَّ هُوَ عَلَيْهِ تَوَكَّلْتُ وَهُوَ رَبُّ الْعَرْشِ الْعَظِيمِ **/ /***********************/ /* ███╗░░░███╗░█████╗░███╗░░░███╗░█████╗░ ████╗░████║██╔══██╗████╗░████║██╔══██╗ ██╔████╔██║██║░░██║██╔████╔██║██║░░██║ ██║╚██╔╝██║██║░░██║██║╚██╔╝██║██║░░██║ ██║░╚═╝░██║╚█████╔╝██║░╚═╝░██║╚█...
C++
4af59df1bc56ca8eb5913c2e57905922
1237d055bc9c363ac32e3ae4f0e19195
800
PASSED
#include<bits/stdc++.h> #include<string> #define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long int using namespace std; const int N=1e5; //ll arr[N]; //int v[N],g[N],temp[N]; ll lcm(int a,int b){ return (a*b)/__gcd(a,b); } set<int> divs(int n) { set<int>s; ...
C++
4af59df1bc56ca8eb5913c2e57905922
fe1e71f037269479d59a9c0c3ac9f979
800
PASSED
#include <iostream> #include<bits\stdc++.h> using namespace std; void init(){ cin.tie(0); cin.sync_with_stdio(0); } int main(){ init(); int t; cin >> t; while(t--) { long long n; cin >> n; long long arr[n]; for(int i = 0; i < n; i++) cin >> arr[i]; sort(arr, arr+n); string a...
C++
4af59df1bc56ca8eb5913c2e57905922
d975e198b1f148b0f0c7e89d1fdf6877
800
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2*1e5+10; ll a[N]; int main() { ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); int t; cin >> t; while(t--){ ll sum1 = 0,sum2 = 0; int n; cin >> n; for(int i = 1;i <= n;i++){ cin >> a[i]; } sort(a + 1,a + ...
C++
4af59df1bc56ca8eb5913c2e57905922
05a0a7d7edf7aa2d962f0448b29c62fb
800
PASSED
#include<iostream> #include<algorithm> using namespace std; const int N=1e+6+100; typedef long long ll; ll a[N]; int main() { int t; cin>>t; while(t--) { int n; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; sort(a+1,a+n+1); ll ans=a[1],sum=0; //ans为蓝色,sum为红色; ll c=n/2; for(int i=2,j=n;i<=n&&j!=i;i++...
C++
4af59df1bc56ca8eb5913c2e57905922
35af792be80b93662eb2794fc8ad8e69
800
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; const int maxn = 1e6 + 100; int a[maxn]; signed main() { int t; cin>>t; while(t--) { int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; // cout<<1<<endl; sort(a,a+n); int l = 0,r = n-1; int cnt1=0,cnt2=0,sum1=0,sum2=0,flag=1; while(l<=...
C++
4af59df1bc56ca8eb5913c2e57905922
d5b5254f6280dd59e44ff958f22df0e2
800
PASSED
#include <bits/stdc++.h> #define tc ll _t_; cin >> _t_; while (_t_--) #define init(x,y) memset(x, y, sizeof(x)) #define all(x) x.begin(), x.end() #define ll long long #define pb push_back #define sz(x) x.size() #define endl "\n" using namespace std; int dx[] = {1,...
C++
4af59df1bc56ca8eb5913c2e57905922
e61071b00dc8e80d914d48acbc665a4c
800
PASSED
#include <iostream> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t=1; cin>>t; while(t--) { long long n; long long s; cin>>n>>s; n=(n*n); cout<<(s/n)<<"\n"; } return 0; }
C++
7226a7d2700ee52f52d417f404c42ab7
747c309a77a2b51328107a620f95ffe6
800
PASSED
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; int i; for(i=0;i<t;i++) { long long int n; long long int s; cin >> n >> s; int a; long double b; a=(s-n*n+1)/(n*n-n+1); b=(long double)(s-n*n+1)/(n*n-n+...
C++
7226a7d2700ee52f52d417f404c42ab7
6ed10b2932a88d3a9fe9e5e9c4c755f9
800
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0), cin.tie(0); long long int t=1; cin>>t; while(t--){ long long int n, num, sum; cin>>n>>sum; long long answer=sum/(n*n); cout<<answer<<'\n'; } return 0; }
C++
7226a7d2700ee52f52d417f404c42ab7
b54d152482fa55d559cdb5bc0844a453
800
PASSED
//g++ --std=c++17 main.cpp //alias g++='g++ --std=c++17' #pragma GCC targer("popcnt") #include <iostream> #include <vector> #include <cassert> #include <algorithm> #include <map> #include <set> #include <tuple> #include <cmath> #include <cstdio> #include <unordered_map> #include <queue> #include <iomanip> #include <uno...
C++
7226a7d2700ee52f52d417f404c42ab7
30ad72e8e1c59dc5ed544ef3a168bd9f
800
PASSED
// problem_1646A.cpp : ���� ���� �������� ������� "main". ����� ���������� � ������������� ���������� ���������. // #include <iostream> #include<cmath> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { long long int s; int n; cin ...
C++
7226a7d2700ee52f52d417f404c42ab7
9d68402352d764031151ec978f073940
800
PASSED
#include<iostream> using namespace std; int main(){ int t; cin>>t; int res_arr[t]; for (int i = 0; i<t; i++){ long long n,s; cin>>n>>s; int ans; ans = s/(n*n); res_arr[i] = ans; } for (int j = 0; j<t; j++){ cout<...
C++
7226a7d2700ee52f52d417f404c42ab7
8cea4972aa740b5612a00b4dfa69b19d
800
PASSED
#include<iostream> #include<algorithm> #include<cstring> #include<string> #include<vector> #include<stack> #include<deque> #include<queue> #include<cmath> #include<list> #include<map> #include<set> using namespace std; long long n; long long s; long long t,ans; int main() { ios::sync_with_stdio(fa...
C++
7226a7d2700ee52f52d417f404c42ab7
7013df0cce2e1fafa796e13dd58ec047
800
PASSED
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int t; cin >> t; for(int i=0;i<t;i++) { long long int a,b; cin >> a; cin >> b; long long int count=0; count =b/(a*a); cout << count <<"\n"; } return 0; }
C++
7226a7d2700ee52f52d417f404c42ab7
b4bec1fd3da09cc0bb8c4c6d16f5a8ad
800
PASSED
#include <iostream> using namespace std; int main() { int t; cin >> t; for(int i=0;i<t;i++) { long long int a,b; cin >> a; cin >> b; long long int count=0; /*while (c<=b) { c=c+a*a; count++; }*/ count =b/(a*a); cout << count <<"\n"; ...
C++
7226a7d2700ee52f52d417f404c42ab7
3fe267aed5f3aaa2d601ce46745b63a8
800
PASSED
#include<iostream> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--){ long long n,s; cin>>n>>s; long long ans=0; ans = s/(n*n); cout<<ans<<"\n"; } }
C++
7226a7d2700ee52f52d417f404c42ab7
227c59cf61ab491f3ae42bf59a8c4e1a
800
PASSED
#include<iostream> #include<stack> #include<list> #include<set> #include<vector> #include<algorithm> #include<math.h> #include<numeric> #include<map> #include<cstring> #include<queue> #include<iomanip> #include<cmath> #include<queue> #include <bitset> #include<unordered_map>/* #ifndef local #define e...
C++
ff0b041d54755984df3706aae78d8ff2
e916097c38641183979b65505aadf9e4
1,500
PASSED
#include<iostream> #include<stack> #include<list> #include<set> #include<vector> #include<algorithm> #include<math.h> #include<numeric> #include<map> #include<cstring> #include<queue> #include<iomanip> #include<cmath> #include<queue> #include <bitset> #include<unordered_map>/* #ifndef local #define e...
C++
ff0b041d54755984df3706aae78d8ff2
226f8b671326bb0b0e50e0279a546478
1,500
PASSED
#include<iostream> #include<stack> #include<list> #include<set> #include<vector> #include<algorithm> #include<math.h> #include<numeric> #include<map> #include<cstring> #include<queue> #include<iomanip> #include<cmath> #include<queue> #include <bitset> #include<unordered_map>/* #ifndef local #define e...
C++
ff0b041d54755984df3706aae78d8ff2
eae4401658c41ae10fd9ec54e63e9f27
1,500
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF=1e9+7; const ll INFF=1e18+7; #define nl '\n' void __print(int x) { cout << x; } void __print(long x) { cout << x; } void __print(long long x) { cout << x; } void __print(unsigned x) { cout << x; } void __print(unsigned long ...
C++
ff0b041d54755984df3706aae78d8ff2
9fc64f74ff3f53a937aeba673ee5c8c2
1,500
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 one_count(ll n){ ...
C++
ff0b041d54755984df3706aae78d8ff2
87c35620dd6d47989ad9067931a39e53
1,500
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 one_count(ll n){ ...
C++
ff0b041d54755984df3706aae78d8ff2
9da4bff6e204da50ae284aadaa8d28c5
1,500
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 one_count(ll n){ ...
C++
ff0b041d54755984df3706aae78d8ff2
0557ec400bffb68efb93ea0694446311
1,500
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 one_count(ll n){ ...
C++
ff0b041d54755984df3706aae78d8ff2
4cf0fba1ce510012baaf6ed8cc9f1f4f
1,500
PASSED
#include <bits/stdc++.h> #include <cmath> // https://codeforces.com/contest/1646/problem/C using namespace std; const int FACTORIALS_ARR_SIZE = (14 - 3) + 1; // start from 3! until 14! long long FACTORIALS_OF[FACTORIALS_ARR_SIZE]; int main() { // we will not consider 1! and 2! // we will only build terms...
C++
ff0b041d54755984df3706aae78d8ff2
270245aa41ebdd7fc89e4145b322078d
1,500
PASSED
#include <bits/stdc++.h> #include <cmath> // https://codeforces.com/contest/1646/problem/C using namespace std; const int FACTORIALS_ARR_SIZE = (14 - 3) + 1; // start from 3! until 14! int main() { // we will not consider 1! and 2! // we will only build terms that are exclusive to factorials // 1! an...
C++
ff0b041d54755984df3706aae78d8ff2
770203b7027526738d12ad5bfd548c4f
1,500
PASSED
#include <bits/stdc++.h> #define int long long #define pb push_back using namespace std; int mod = 998244353; int pow1(int n,int k){ if(k<=0)return 1; int c=1; int t=k; while(t--){ c*=n; } return c; } int gcd(int a,int b){ if(a<b){ swap(a,b); } i...
C++
dc3848faf577c5a49273020a14b343e1
a7792ffa225713974720c5fa4e270eb6
2,000
PASSED
#include<bits/stdc++.h> using namespace std; const int maxn = 2e5+100; vector<int>edg[maxn]; struct node{ int cnt,val; int sum = 0; }dp[maxn][2]; bool vis[maxn]; void dfs(int u,int pre) { for(int i=0;i<edg[u].size();++i){ if(edg[u][i]==pre) continue; dfs(edg[u][i],u...
C++
dc3848faf577c5a49273020a14b343e1
464403d074620b0201e612b945e57a48
2,000
PASSED
// Problem: D. Weight the Tree // Contest: Codeforces - Codeforces Round #774 (Div. 2) // URL: https://codeforces.com/contest/1646/problem/D // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include<iostream> #include<cstring> #include<algorithm> #include<vec...
C++
dc3848faf577c5a49273020a14b343e1
48870b925244c918ecd96aa28d9123a1
2,000
PASSED
#include <bits/stdc++.h> #define int long long #define sc(x) scanf("%lld", &x) #define rep(i, x, y) for(int i = x; i <= y; ++i) #define dep(i, x, y) for(int i = x; i >= y; --i) using namespace std; const int maxn = 1e6 + 10; struct Dynamtic{ int val_1, val_2; Dynamtic(){} Dynamtic(int x, i...
C++
dc3848faf577c5a49273020a14b343e1
5d0186420023b9392f95d7d64b7307b6
2,000
PASSED
// ___ _ _ ___ _____ _____ _ ___ // / __| | | | | | _| |_ _| | _ | | | | \ // / /__ | |__| | | |_ | | | | | | | | | _ \ // /___ / | __ | | _| | | | | | | | | ||_| | // __/ / | | | | | |_ | | | |_| | | |__ | / // |___/ |_| |_| |___| |_| ...
C++
dc3848faf577c5a49273020a14b343e1
44d0e294d5c07045acc77e2dfbd3405d
2,000
PASSED
#include <bits/stdc++.h> using namespace std; int n,b1,b2,r,C[200010]; long long u; vector<int> V[200010]; pair<int,int> DP[200010][2]; int bolji(int x) { if(DP[x][0].first>DP[x][1].first) return 0; if(DP[x][1].first>DP[x][0].first) return 1; if(DP[x][0].second>DP[x][1].second) return 1; ...
C++
dc3848faf577c5a49273020a14b343e1
918224b7974d310bac3b509e1880f5aa
2,000
PASSED
#include <bits/stdc++.h> #define ll long long #define int ll using namespace std; const int maxn = 2e5 + 5; int n; int st[maxn]; pair <int, int> dp[maxn][2]; vector <vector <int> > adj; void init () {} bool operator > (pair <int, int> &a, pair <int, int> &b) { if (a.first != b.first) return a.first > ...
C++
dc3848faf577c5a49273020a14b343e1
07cd82f2795133207298e0737a881c34
2,000
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef std::deque<ll> di; typedef std::vector<ll> vi; typedef std::pair<ll,ll> pr; typedef std::vector<pr> vii; #define rep(i, n) for (ll i = 0; i < n; i++) #define repn(i, a, n) for (ll i = a; i < n; i++) #define all...
C++
dc3848faf577c5a49273020a14b343e1
d5b09d0bce10ac688c98e3dfc38ce08c
2,000
PASSED
#include<bits/stdc++.h> #define int long long #define INF 1e+15 #define fastScan std::ios::sync_with_stdio(0),cin.tie(0) using namespace std; vector<int> adj[200005]; int ap[200005],d[200005][2],d1[200005][2]; int solve(int u,int p,int b) { if(d[u][b]!=-1) return d[u][b]; d[u][b]=INF; ...
C++
dc3848faf577c5a49273020a14b343e1
d263ed0a3664ddf5357fd06bc4aac450
2,000
PASSED
#include<bits/stdc++.h> #define ll long long #define endl "\n" #define int long long #define xiayang cout<<"嘴硬"<<endl; #define FAST std::ios::sync_with_stdio(false);std::cin.tie(0);std::cout.tie(0); const int maxn = 2e5+10; const int inf = 0x3f3f3f3f3f; using namespace std; struct node{ int ok,val,id; }; i...
C++
dc3848faf577c5a49273020a14b343e1
1f69beaf7f6c630809c023ecc65b2bba
2,000
PASSED
#include <bits/stdc++.h> #include <chrono> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; /*............................................................................*/ #define ordered_set tree<int, null_type,less<int>, rb_tree_ta...
C++
e8113779d4ab38d90cb16eea97019494
a9a6130fa12bc6a03ce23849344c2a16
2,900
PASSED
# include <stdio.h> # include <random> # include <time.h> std::mt19937 ran(time(0)); int a[110][110],b[110][110]; int rem[20010][110],totr,n; int hav[110],loc[110]; int bel[110],cun; int pre(int x) { return (x+n-2)%n+1; } int nxt(int x) { return x%n+1; } void done() { int i,j; totr++; for(i=1;i<=n;i++) { for(j=...
C++
e8113779d4ab38d90cb16eea97019494
6980729dc5a5476835f32fd365f569e1
2,900
PASSED
#include <bits/stdc++.h> #include <math.h> using namespace std; //1,2..., i, i+1,...n,1,... //не более n^2-n шагов //n [2:100] // int n; vector<vector<int>> c;//карты vector<vector<int>> d;//количество карт на руке. list<vector<int>> moves; vector<int> isDiversed; int diverseCounter; bool isPlayerDiverse...
C++
e8113779d4ab38d90cb16eea97019494
9a973d4e59c36ffd0242474c9deb3d8b
2,900
PASSED
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define FOR(i, l, r) for(int i=l;i<r;i++) #define rFOR(i, l, r) for(int i=r-1;i>=l;i--) #define rep(i, l, r) for(int i=l;i<=r;i++) #define rrep(i, l, r) for(int i=r;i>=l;i--) #include<iostream> using namespace std; typedef long long ll; typedef pa...
C++
e8113779d4ab38d90cb16eea97019494
f667c5f3e07c153648f60b09ff0e3949
2,900
PASSED
#include<bits/stdc++.h> #include <stdio.h> #include <algorithm> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define sc(x) scanf("%d", &x) #define scl(x) scanf("%lld", &x) #define endl '\n' #define pb push_back #define pf push_...
C++
e8113779d4ab38d90cb16eea97019494
840b711bb9b2947e09f706a879234e6f
2,900
PASSED
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define pp pair<int, int> const int N = 110; int n; set<pp> s[N]; vector<int> sol[N]; int brp[N][N] = { 0 }; bool check(){ for (int i = 0; i < n; ++i){ if (s[i].size() != n) return 0; } return 1; ...
C++
e8113779d4ab38d90cb16eea97019494
e5bc958f331666f317293855f4eede0d
2,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int cnt[105][105], d[105]; vector<int> out; int ans; int main() { cin.tie(0)->sync_with_stdio(0); int n, cc; cin >> n; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { cin >> cc; cnt[i][cc]++...
C++
e8113779d4ab38d90cb16eea97019494
89edfec7f3617c82e4b18e37dffcfe5c
2,900
PASSED
#include <bits/stdc++.h> typedef long long int ll; typedef long double ld; #define pb push_back #define pii pair < int , int > #define F first #define S second //#define endl '\n' #define int long long #define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) #pragma GCC optimize("Ofast,no-stack-protector,un...
C++
e8113779d4ab38d90cb16eea97019494
89b878bd9c631f8f97f6101a1e3a5ed9
2,900
PASSED
const long long MOD = 998244353; const long long INF = 1e9; const long long INFLL = 1e18; #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<vector<int> > vvi; typedef vector<ll> vll; typedef c...
C++
e8113779d4ab38d90cb16eea97019494
f241e9ff16f43d3a0a43926cd34a63de
2,900
PASSED
#include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cmath> #include <cassert> #include <ctime> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> using namespace std; #define pb p...
C++
e8113779d4ab38d90cb16eea97019494
56387035597f841cbf64fc392d3b242d
2,900
PASSED
#include <bits/stdc++.h> #define int long long #define endl '\n' using namespace std; const int N=1e6+10; bool resh[N]; void fill() { resh[1]=1; for(int i=2;i*i<N;i++) { if(!resh[i]) for(int j=i*i;j<N;j+=i)resh[j]=1; } } void solve() { int n,e; cin>>n>>e; i...
C++
32130f939336bb6f2deb4dfa5402867d
83e55c01bb7c45b8eaa55f54f5ef148b
1,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef std::int_fast64_t ll; typedef long double ld; typedef pair<int, int> pii; const ll mod = 1e9 + 7; #define pb push_back #define mp make_pair ll gcd(ll a, ll b) { if (b == 0)return a; else return abs(gcd(b, a % b)); } ll pow(ll base, ll e...
C++
32130f939336bb6f2deb4dfa5402867d
e4ba917de0d76fd14cddccced0deae49
1,400
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; #define nline "\n" #define M 10000000007 #define int long long #d...
C++
32130f939336bb6f2deb4dfa5402867d
e6b80b7a7f35eecc02935bc580003132
1,400
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; #define nline "\n" #define M 10000000007 #define int long long #d...
C++
32130f939336bb6f2deb4dfa5402867d
8784fd5d80e593284bde177696d30fe2
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long int T,n,e; int prime[1000005]={0},a[200005],vis[200005]; void pre() { for(int i=2;i<=1000000;++i){ if(prime[i]) continue; for(int j=2;i*j<=1000000;++j){ prime[i*j]=1; } } } int main() { ...
C++
32130f939336bb6f2deb4dfa5402867d
166b650b1e4faf809b4c900365caae79
1,400
PASSED
#include<iostream> #include<cstring> #include<vector> #include<map> #include<queue> #include<unordered_map> #include<cmath> #include<cstdio> #include<algorithm> #include<set> #include<cstdlib> #include<stack> #define forin(i,a,n) for(int i=a;i<=n;i++) #define forni(i,n,a) for(int i=n;i>=a;i--) using namespace std; type...
C++
32130f939336bb6f2deb4dfa5402867d
053af9038ba0d8866f030263ba0fa4d3
1,400
PASSED
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; #define vt vector #define pii pair<int, int> #define vi vt<int> #define vpi vt<pii> #define vvi vt<vi> #define mi map<int, int> #define pb push_back #define ppb pop_back #define mp make_pair #define F first #define S second #define case cout...
C++
32130f939336bb6f2deb4dfa5402867d
e422dd09bcc38b793e4e1f58b1cc25c7
1,400
PASSED
#include<bits/stdc++.h> using namespace std; #define MAXN 1000001 bool prime[MAXN]; vector<pair<int,int>> seq[200001]; void eratosthenes() { fill(prime,prime+MAXN,true); prime[0] = false; prime[1] = false; for (long long i=2; i<MAXN; i++) if (prime[i]) for (long long j=i*i; j<MAXN; j+...
C++
32130f939336bb6f2deb4dfa5402867d
f73a5a662ffcad4bc62660690d9b7084
1,400
PASSED
/* * @Description: prac * @Autor: Eloise * @Date: 2021-11-06 21:47:57 * @LastEditTime: 2021-12-01 15:28:55 */ #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define endl '\n' const ll MAXN = 2e5 + 7; // const ll INF = (1ll << 31) - 1ll; const ll INF = 0x3f3f3f3f;...
C++
32130f939336bb6f2deb4dfa5402867d
de64fd91d240a9c4d5e6ba8fc3d020a1
1,400
PASSED
//created : abhinav #include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define nline "\n" #define r 200000 #define all(x) x.begin(),x.end() #define ms0(s) memset(s,0,sizeof s) #define ff first #define ss second typedef long long int ll; #define bs binary_search #define lb lower_bound #def...
C++
32130f939336bb6f2deb4dfa5402867d
e81449dabb3769a9ba6d07383bf20f87
1,400
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long #define add(a) push_back(a) ll solve(vector<ll> in, int len) { if(len < 2) return in[0]; sort(in.begin(), in.end()); ll max = 0,sum = 0; vector<ll> even, temp = in; while(1) { bool cont = 1; for(int i = len-1;...
C++
f5de1e9b059bddf8f8dd46c18ce12683
efaad95c6b1626b9ef17ea1a47738974
900
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define loop(n) for(int i=0;i<n;i++) #define all(x) x.begin(),x.end() #define ll long long #define endl "\n" using name...
C++
f5de1e9b059bddf8f8dd46c18ce12683
fefadd5494fdf2e80d3c818fbabe7984
900
PASSED
#include<iostream> #include<cstring> #include<vector> #include<algorithm> #include<map> #include<cmath> using namespace std; //const int N=2e5+100; int n,m,t; long long num[30],ans,tmp; map<long long ,long long >mp; inline long long my_pow(int x,int k) { long long res=1; for(int i=1;i<=k;i++)res*=x; return res; ...
C++
f5de1e9b059bddf8f8dd46c18ce12683
97daa781573d207ca3922e60d117d332
900
PASSED
#include<bits/stdc++.h> using namespace std; bool is_arr[17] = {0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}; int siz[17] = {0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4}; int val[17] = {0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1}; int cmp(int a, int b) { return a > b; } int main(void) { ...
C++
f5de1e9b059bddf8f8dd46c18ce12683
ee076f424c61a005c53f334bc187340f
900
PASSED
#include <iostream> #include <algorithm> #include <string> #include <cstring> #include <cmath> #include <map> #include <vector> #define Swap(a,b) {int t=a;a=b;b=t;} using namespace std; const int maxn = 20; int a[maxn]; int main() { int tt,n; scanf("%d", &tt); while (tt--) { scanf("%d", &n); int pos = 0; long...
C++
f5de1e9b059bddf8f8dd46c18ce12683
b81a380f6d6048f6b785052592923669
900
PASSED
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define allr(x) (x).rbegin(), (x).rend() #define pb push_back using namespace std; int main() { cin.sync_with_stdio(0), cin.tie(0); int t, n, x, divs; long long ans, cur; cin >> t; while (t--) { divs = 0; ans = -...
C++
f5de1e9b059bddf8f8dd46c18ce12683
b3ef2511df2323170bcf68416fe84f78
900
PASSED
#include <iostream> using namespace std; const int N = 20; long long a[N]; int t, n; int main() { scanf("%lld", &t); while (t--) { long long cnt = 0; long long sum = 0; int maxn = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); while (a[i] % 2 == 0) { a[i] /= 2; c...
C++
f5de1e9b059bddf8f8dd46c18ce12683
f5983ff15c1763327aba479b1b1cc2c5
900
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll t,n,a[19],sum,cnt; int main() { cin >> t; while(t--) { memset(a,0,sizeof(a)); cnt = 0,sum = 0; cin >> n; for(int i = 0;i < n;i++) { cin >> a[i]; } for(int i = 0;i < n;i...
C++
f5de1e9b059bddf8f8dd46c18ce12683
4f122db8f601e393839ae4a276593fcf
900
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ int t,n,a[20]={0}; long long sum=1,sum2=0; scanf("%d",&t); while(t--){ scanf("%d",&n); sum2=0; sum=1; for(int i=0;i<n;i++){ scanf("%d",&a[i]); while(a[i]%2==0){ sum*=2; a[i]/=2; } } sort(a,a+n); for(int i=0;i<n-1;i++){ sum2+=...
C++
f5de1e9b059bddf8f8dd46c18ce12683
d3c76ccba7e84be9482bdf65a5dc1029
900
PASSED
/* * @Description: prac * @Autor: Eloise * @Date: 2021-11-06 21:47:57 * @LastEditTime: 2021-12-01 13:02:51 */ #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define endl '\n' const ll MAXN = 2e5 + 7; // const ll INF = (1ll << 31) - 1ll; const ll INF = 0x3f3f3f3f;...
C++
f5de1e9b059bddf8f8dd46c18ce12683
194ff0a81502ec3d371eea9685d4e981
900
PASSED
/** Code by: ASHWANI SONI **/ #include <bits/stdc++.h> using namespace std; #define int long long #define fo(i,a,b) for(int i=a;i<b;i++) #define fa(x,y) for(auto x: y) #define rajdhani ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define all(x) x.begin(),x.end() #define sva(vi) sort...
C++
db473ad780a93983667d12b1357c6e2f
9a4981aae087ad348dfa3b2f1e5cfd1b
1,100
PASSED
#include <bits/stdc++.h> #include <utility> #include <math.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) template <typename T> using ordered_set ...
C++
db473ad780a93983667d12b1357c6e2f
97ee1dd5ea2dd6307163d3024b8c0652
1,100
PASSED
#include <bits/stdc++.h> #include <utility> #include <math.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) template <typename T> using ordered_set ...
C++
db473ad780a93983667d12b1357c6e2f
5bea864999b687b0c0855ec6386df6db
1,100
PASSED
#include <bits/stdc++.h> #include <utility> #include <math.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) template <typename T> using ordered_set ...
C++
db473ad780a93983667d12b1357c6e2f
885c8dc926a82805fb779795d4ad2a86
1,100
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ios::sync_with_stdio(0);cin.tie(0); mt19937 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count()); auto start=chrono::high_resolution_clock::now(); //code here int n, q; ...
C++
db473ad780a93983667d12b1357c6e2f
f9b7cf26902fdc7fac353b51c59b3c17
1,100
PASSED
#include <string> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <cmath> #include <unordered_map> #include <unordered_set> #include <map> #include <set> #include <ctime> // #define int long long #define endl '\n' #define br putch...
C++
db473ad780a93983667d12b1357c6e2f
ea158477b59b846a13dabd16f29661a3
1,100
PASSED
#include <string> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <cmath> #include <unordered_map> #include <unordered_set> #include <map> #include <set> #include <ctime> #define int long long #define endl '\n' #define br putchar(...
C++
db473ad780a93983667d12b1357c6e2f
0a7febb5709d0364c35b3511cea9b12c
1,100
PASSED
#include <string> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <cmath> #include <unordered_map> #include <unordered_set> #include <map> #include <set> #include <ctime> #define int long long #define endl '\n' #define br putchar(...
C++
db473ad780a93983667d12b1357c6e2f
7138d01f91cda29c97227e3848fcf0a4
1,100
PASSED
#include <string> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <cmath> #include <unordered_map> #include <unordered_set> #include <map> #include <set> #include <ctime> #define int long long #define endl '\n' #define br putchar(...
C++
db473ad780a93983667d12b1357c6e2f
b9339731f31a476057540309e49c1ca6
1,100
PASSED
#include <string> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <cmath> #include <unordered_map> #include <unordered_set> #include <map> #include <set> #include <ctime> #define int long long #define endl '\n' #define br putchar(...
C++
db473ad780a93983667d12b1357c6e2f
8dd11fd359214743a0a03a99e62390bf
1,100
PASSED
#include <unordered_map> #include <unordered_set> #include <iomanip> #include <map> #include <iterator> #include <deque> #include <queue> #include <sstream> #include <string> #include <numeric> #include <set> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #include <cmath> #include <algorithm...
C++
29bc7a22baa3dc6bb508b00048e50114
f7497ccd5a8392e3d0886bcab45c4089
1,600
PASSED