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> #define ll long long #define mod 1000000007 #define N 200010 #define long_long_MAX 9187201950435737471 #define long_long_MIN -9187201950435737472 #define int_MAX 2139062143 #define int_MIN -2139062144 #define jh(x, y) (x ^= y ^= x ^= y) #define loc(x, y) ((x - 1) * m + y) #define lowb...
C++
20783d008f54becf7e47df3279a69fcb
344f80d5756fe4ff062e690d40666719
2,800
PASSED
//#define _GLIBCXX_DEBUG #define AIDAR ASADULLIN #include <bits/stdc++.h> using namespace std; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); #define ll long long #define trace(x) cout << #x << " = " << (x) << endl; #define all(x) x.begin(), (x).end() #define rall(x) x.rbegin(), (x...
C++
20783d008f54becf7e47df3279a69fcb
1942f3d9c0d1e3c091d8dd8759074844
2,800
PASSED
#include<bits/stdc++.h> using namespace std; const int sz = 2e5 + 1; const int log_ = 14; int dp[sz][log_][log_]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); for (int i = 0; i < sz; i++){ for (int j = 0; j < log_; j++){ for (int k = 0; k < log_; k++){ ...
C++
20783d008f54becf7e47df3279a69fcb
f855358a74c5c250d716d36a25066b20
2,800
PASSED
#include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; const int sz = 2e5 + 1; const int log_ = 14; const int sum_b = 28; int dp[sz][log_][log_]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); for (int i = 0; i < sz; i++...
C++
20783d008f54becf7e47df3279a69fcb
98c21de71dde951ea0ad57ecdc2ceba5
2,800
PASSED
#include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; const int sz = 2e5 + 1; const int log_ = 16; const int sum_b = 28; int dp[sz][log_][log_]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); for (int i = 0; i < sz; i++...
C++
20783d008f54becf7e47df3279a69fcb
8c12ab85fafd3672ba35c75e5a65f2e3
2,800
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long int o=1e6; set <int> d; set <int> use; int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n,m; cin>>n>>m; int q1; cin>>q1; while(q1--) { int x,y; cin>>x>>y; ...
C++
20783d008f54becf7e47df3279a69fcb
4e7059bc0537beedb039b41c604cb40b
2,800
PASSED
#include<bits/stdc++.h> int n,m,q,k,x,y,c,p,t,i; std::map<int,int> f[200005],s[2]; int main() { for (std::cin>>n>>m>>q,s[0][1]=1;q--;std::cin>>x>>y,n>m?f[y][x]=1:f[x][y]=1); if (n>m) std::swap(n,m); for (;s[c][n]!=m;c=(++k)&1) for (i=1;i<=n;i++) if (s[c][i]) {p=i+s[c][i]+f[i][s[c][i]],t=p<n?p:n;s[1-c][t]=std:...
C++
20783d008f54becf7e47df3279a69fcb
a400d1e7d9d24cbb9a5ad19ce23fabc5
2,800
PASSED
#include<bits/stdc++.h> int n,m,q,k,x,y,c,p,t,i; std::map<int,int> f[200005],s[2]; int main() { for (std::cin>>n>>m>>q,s[0][1]=1;q--;std::cin>>x>>y,n>m?f[y][x]=1:f[x][y]=1); if (n>m) std::swap(n,m); for (;;c=(++k)&1) { if (s[c][n]==m) return printf("%d\n",k),0; for (i=1;i<=n;i++) if (s[c][i]) {p=i+s[c...
C++
20783d008f54becf7e47df3279a69fcb
a1c468aa3cf3da25641b5674efe94359
2,800
PASSED
#include<bits/stdc++.h> int n,m,q,k,x,y,c,p,t,i; std::map<int,int> f[200005],s[2]; int main() { std::cin>>n>>m>>q;s[0][1]=1; while (q--) std::cin>>x>>y,n>m?f[y][x]=1:f[x][y]=1; if (n>m) std::swap(n,m); for (;;c=(++k)&1) { if (s[c][n]==m) return printf("%d\n",k),0; for (i=1;i<=n;i++) if (s[c][i]) {p=...
C++
20783d008f54becf7e47df3279a69fcb
192d9a641342b9b39389e489e05bad40
2,800
PASSED
import java.util.*; public class Test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); while(tc-->0) { String s = sc.next(); int n = s.length(); int[][][] dp = new int[n][n][2]; for(int i=0;i<n;i++) for...
Java
6cffd0fa1146b250a2608d53f3f738fa
ffebc4309f0e0b6f4c3a01833d4b06f4
1,800
PASSED
import java.util.*; public class Test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); while(tc-->0) { String s = sc.next(); int n = s.length(); int[][][] dp = new int[n][n][2]; for(int i=0;i<n;i++) f...
Java
6cffd0fa1146b250a2608d53f3f738fa
098e02261e3f38ccba73d95a9066d199
1,800
PASSED
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually Give your 100% in the contests and while solving problems */ import java.util.*; import java.io.*; import java...
Java
6cffd0fa1146b250a2608d53f3f738fa
ea04bd1c183dab08606f9855b22cb5d9
1,800
PASSED
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Coder { static StringBuffer s...
Java
6cffd0fa1146b250a2608d53f3f738fa
2043b8f8ed586c4dd8106eacc0de17a6
1,800
PASSED
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Coder { static StringBuffer s...
Java
6cffd0fa1146b250a2608d53f3f738fa
0b3943a98582dea70c5ae35a8955b57e
1,800
PASSED
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Coder { static StringBuffer s...
Java
6cffd0fa1146b250a2608d53f3f738fa
ea95ab48d3b9f4253dfbb5a309c5ce12
1,800
PASSED
// When I wrote this code, only God & I knew what it did. Now only God knows !! import java.util.*; import java.io.*; public class Main { static class FastReader { private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); ...
Java
6cffd0fa1146b250a2608d53f3f738fa
30e52c48fe73dffbc4185330e64ea226
1,800
PASSED
import java.util.*; // import java.lang.invoke.ConstantBootstraps; // import java.math.BigInteger; // import java.beans.IndexedPropertyChangeEvent; import java.io.*; @SuppressWarnings("unchecked") public class Main implements Runnable { static FastReader in; static PrintWriter out; static int b...
Java
6cffd0fa1146b250a2608d53f3f738fa
b9ccd8cc03cab673e425ba925873e3ea
1,800
PASSED
import java.io.*; import java.util.*; public class Main { static Main2 admin = new Main2(); public static void main(String[] args) { admin.start(); } } class Main2 { //---------------------------------INPUT READER-----------------------------------------// public BufferedRead...
Java
6cffd0fa1146b250a2608d53f3f738fa
8dc0c8a42b6d5ffb2a4442e1336dadff
1,800
PASSED
import java.io.*; import java.util.*; public class Main { static Main2 admin = new Main2(); public static void main(String[] args) { admin.start(); } } class Main2 { //---------------------------------INPUT READER-----------------------------------------// public BufferedRead...
Java
6cffd0fa1146b250a2608d53f3f738fa
7a2cf672628b503b98ea493832e471f5
1,800
PASSED
#include<bits/stdc++.h> using namespace std; const int maxn=2e5+5; int main(){ int t; scanf("%d",&t); while(t--){ priority_queue<int>qa,qb; int n; scanf("%d",&n); int temp; for(int i=0;i<n;++i){ scanf("%d",&temp); qa.push(temp); } for(int i=0;i<n;++i){ scanf("%d",&temp); qb...
C++
b017204679bab4c0573b03d35b8ae3f2
d1d7cd5f19b0896553a87d932fc3d393
1,400
PASSED
#include<bits/stdc++.h> using namespace std; const int maxn=2e5+5; int main(){ int t; scanf("%d",&t); while(t--){ priority_queue<int>qa,qb; int n; scanf("%d",&n); int temp; for(int i=0;i<n;++i){ scanf("%d",&temp); qa.push(temp); } for(int i=0;i<n;++i){ scanf("%d",&temp); qb...
C++
b017204679bab4c0573b03d35b8ae3f2
65f46c4a75a218c187cd156eed2f8b10
1,400
PASSED
#include<bits/stdc++.h> using namespace std; const int maxn = 2010; //#define debug int n, x; void solve() { scanf("%d", &n); priority_queue<int> qa, qb; for (int i = 0; i < n; ++i) { scanf("%d", &x); qa.push(x); } for (int i = 0; i < n; ++i) { scanf("%d", &x); qb.push(x); } int res = ...
C++
b017204679bab4c0573b03d35b8ae3f2
5d9d6152e92b7c96bf2ca6ba415754dd
1,400
PASSED
//YOU WILL MAKE IT #include <bits/stdc++.h> using namespace std; void solve(){ int n;cin>>n; multiset<int> s,s1; map<int,int> m,m1; for(int i=0;i<n;i++){ int j;cin>>j; s.insert(j); m[j]++; } for(int i=0;i<n;i++){ int j;cin>>j; s1.insert(j); m1[j]++; } int ans=0,u...
C++
b017204679bab4c0573b03d35b8ae3f2
ed86c1acb984dd9d0faa987631dda468
1,400
PASSED
#include<iostream> #include<cstdio> #include<algorithm> #include<map> using namespace std; const int N=2e5+10; typedef long long LL; map<LL,LL> m; LL a[N],b[N]; LL get10(LL x) { LL sum=0; while(x) { x=x/10; sum++; } return sum; } void solve() {...
C++
b017204679bab4c0573b03d35b8ae3f2
ebe982b1e76cf88209cf8890bae6a85e
1,400
PASSED
#include <bits/stdc++.h> using namespace std; bool SoSanh(const int &a,const int &b){ return a>b; } int countNumber(int v){ int dem=0; while (v!=0) { ++dem; v/=10; }; return dem; } void solve(){ vector<int> a; vector<int> b; int n; ci...
C++
b017204679bab4c0573b03d35b8ae3f2
1d3c924f03de663530e0ec9e29d3a472
1,400
PASSED
#include <bits/stdc++.h> using namespace std; int countNumber(int v){ int dem=0; while (v!=0) { ++dem; v/=10; }; return dem; } int main() { int t; cin>>t; while (t--){ int n; cin>>n; vector<int> a(n),b(n); for (in...
C++
b017204679bab4c0573b03d35b8ae3f2
b932a94a1b482eeba7a8996efce7a5ab
1,400
PASSED
//TLE #include<algorithm> #include<iostream> #include<vector> #include<map> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #define ll long long #define F first #define S second #define PB push_back #define MP make_pair #define rep(i, a, b) for (int i{a}; i<b; i++) using namespace st...
C++
b017204679bab4c0573b03d35b8ae3f2
78e5e7433e92bbd3af1d9432b25a4879
1,400
PASSED
//TLE #include<algorithm> #include<iostream> #include<vector> #include<map> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #define ll long long #define F first #define S second #define PB push_back #define MP make_pair #define rep(i, a, b) for (int i{a}; i<b; i++) using namespace st...
C++
b017204679bab4c0573b03d35b8ae3f2
3551672ae2cef1fde1ac4ae2c386df0f
1,400
PASSED
//Yamero codeforces-chan/atcoder-chan/quera-chan //#pragma GCC optimize ("O3,unroll-loops") //#pragma GCC target ("avx2,bmi,bmi2,popcnt") #include <bits/stdc++.h> #define F first #define pb push_back #define sz size() #define S second using namespace std; typedef long long int ll; const int N = 1e6 + 10; i...
C++
b017204679bab4c0573b03d35b8ae3f2
0206e68875ee81998108e689ca070eb5
1,400
PASSED
#include<iostream> #include<cstring> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<math.h> #include<numeric> #include<unordered_map> using namespace std; #define line '\n' #define l long #define ll long long #define v vector<int> #define vi vector<long long> #define vll v...
C++
779ab09a588bbb52485ae5b6a441b235
cc59bad09786f44bbbfd2171f2c087b6
800
PASSED
#include <iostream> using namespace std; int a,b,c; int main() { scanf("%d",&a); for (int i=1;i<=a;i++) { int d=0,e=0; scanf("%d",&b); for(int i=1;i<=b;i++) { scanf("%d",&c); if(e<c) { e=c; d=i; } } printf("%d\n",d); } return 0; }
C++
779ab09a588bbb52485ae5b6a441b235
275623ac7b9478a72dace0035e09b1e1
800
PASSED
#include<iostream> using namespace std; int main() { int N,n,ans,val; cin>>N; while(N--) { val=0; cin>>n; for(int i=1;i<=n;i++) { int k; cin>>k; if(val<k) { val=k; ans=i; } } cout<<ans<<endl; } return 0; }
C++
779ab09a588bbb52485ae5b6a441b235
e97f16e36c7442174133a0571f361fc1
800
PASSED
#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N = 100010; int T; int main() { scanf("%d", &T); while(T --) { int n; scanf("%d", &n); //int cnt[25]; int t; int Max = -1; int res; for (int i = 0; i < n; i ++) { ...
C++
779ab09a588bbb52485ae5b6a441b235
0d4699f0482bd21efba0c69f41a58055
800
PASSED
#include <iostream> #include <stdio.h> using namespace std; #include <cmath> #include <stdio.h> #include <istream> #include <sstream> #include <time.h> int main() { int t, n, cnt[20], i, j, k, x, y, jud, op[1000]; cin >> t; for (i = 0; i < t; i++) { cin >> n; for (j = 0; j < n; j++) { cin >> cnt[j]; } if...
C++
779ab09a588bbb52485ae5b6a441b235
7d13e7e4aa5a246af8e728372898d05d
800
PASSED
#include<stdio.h> int main() { int t,n,q[100]; scanf("%d",&t); for(int i=1;i<=t;i++) { int wei=1; scanf("%d",&n); for(int k=0;k<n;k++) { scanf("%d",&q[k]); } int max=q[0]; for(int b=0;b<n;b++) { if(max<=q[b]) ...
C++
779ab09a588bbb52485ae5b6a441b235
8268eac0c01fe8eea6119b386efc307d
800
PASSED
#include <bits/stdc++.h> //#pragma GCC optimize (2) #define MOD 1000000007 #define NUM 100005 using namespace std; typedef long long ll; ll gcd(ll x,ll y) { return y==0?x:gcd(y,x%y); } ll lcm(ll x,ll y) { return x/gcd(x,y)*y; } template <class T> lowbit(T x) { return x&(-x); } int read() { int ans=0; char c=getcha...
C++
779ab09a588bbb52485ae5b6a441b235
d6461d4e487c6da553fb3d924e0b215b
800
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; void solve(){ int n,ma=0,mi=0; cin>>n; for(int i=1;i<=n;i++){ int x;cin>>x; if(x>=ma){ma=x;mi=i;} } cout<<mi<<'\n'; } int main(){ int t;cin>>t; while(t--){ solve(); } } ...
C++
779ab09a588bbb52485ae5b6a441b235
9c7453a44a0b7996c33e1f0d63cfa297
800
PASSED
//Author:Zealous_YH / Cream_H //Hai Bian & Xiao Bao #include <bits/stdc++.h> #define ET return 0 #define fi first #define se second #define mp make_pair #define pb push_back #define ll long long #define ull unsigned long long #define bk break #define ctn continue #define inf INT_MAX #define uinf INT_MIN #define prq pri...
C++
779ab09a588bbb52485ae5b6a441b235
7e070826d271f90a007a98f678e1cd0c
800
PASSED
#include <bits/stdc++.h> using namespace std; void solve(){ int n,x; cin>>n; vector<int> v(n,0); int maxi=0,indi=1; for(int i=1;i<=n;i++){ int x; cin>>x; maxi=max(maxi,x); if(x==maxi) indi=i; } cout<<indi<<"\n"; } int main() { ios_base::sync_with_stdio...
C++
779ab09a588bbb52485ae5b6a441b235
b721342f5b4b96a7e91569b6f5c367e7
800
PASSED
#include <bits/stdc++.h> #define ll long long #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define ci(v) for(auto& i : v) cin>>i #define co(vec) for(auto& i : vec) cout << i << " "; cout << "\n"; using namespace std; void Accepted(){ ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.ti...
C++
9cc18b914678cb18213b2a52259de35d
7835a54b3f40a5780c842f922d19e6bf
800
PASSED
#include <bits/stdc++.h> #define ll long long #define pii pair<int,int> #define st first #define nd second #define rep(i,n) for(int i=0 ; i<n ; i++) #define pb push_back #define mp make_pair using namespace std; bool is(int n){ for(int i=2; i*i<=n ; i++){ if(n%i==0)return false; } retu...
C++
9cc18b914678cb18213b2a52259de35d
c34bc9d5b328efc84baecae986a1094c
800
PASSED
#include <bits/stdc++.h> //#pragma GCC optimize ("03") #define FastIO ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) #define FILES freopen("in" , "r" , stdin) , freopen("out" , "w" , stdout) #define ll long long #define ull unsigned long long #define ld long double #define eb emplace_back #define p...
C++
9cc18b914678cb18213b2a52259de35d
d582467019ffb953e528f474c5e7b4ed
800
PASSED
//BOSS// #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define vi vector<int> #define imp map<int,int> #define smp map<int,string> #define rep(i,n) for(int i=0;i<n;i++) const int N=1e9 +7; signed main(){ int ct; cin>>ct; while(ct--){ int n; cin>>...
C++
9cc18b914678cb18213b2a52259de35d
e41b9f823e2ddf83ac785b1eaa44b62f
800
PASSED
//BOSS// #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define vi vector<int> #define imp map<int,int> #define smp map<int,string> #define rep(i,n) for(int i=0;i<n;i++) const int N=1e9 +7; signed main(){ int ct; cin>>ct; while(ct--){ int n; cin>>...
C++
9cc18b914678cb18213b2a52259de35d
c57b80eb85ac691eb2be11b9397b93d4
800
PASSED
//BOSS// #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define vi vector<int> #define imp map<int,int> #define smp map<int,string> #define rep(i,n) for(int i=0;i<n;i++) const int N=1e9 +7; signed main(){ int ct; cin>>ct; while(ct--){ int n; cin>>...
C++
9cc18b914678cb18213b2a52259de35d
56106808f9964b55f61ba7f0dc6bfc6a
800
PASSED
//BOSS// #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define vi vector<int> #define imp map<int,int> #define smp map<int,string> #define rep(i,n) for(int i=0;i<n;i++) const int N=1e9 +7; signed main(){ int ct; cin>>ct; while(ct--){ int n; cin>>...
C++
9cc18b914678cb18213b2a52259de35d
d50548c73c2f26073db5daa748bdb306
800
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll mod = 1e9 + 7; ll pow(ll base, ll exp, ll mod) { ll ans = 1; for (ll i = 0; i < exp; i++) ans = (ans * base) % mod; return ans; } ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b...
C++
9cc18b914678cb18213b2a52259de35d
e45453c87571da4f4c79164b75dac844
800
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long #define lld long double #define lcm(x,y) (x/__gcd(x,y)*y) #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define pb push_back #define ppb pop_back #define ff first #define ss ...
C++
9cc18b914678cb18213b2a52259de35d
64291f66aeedbdd756522d5bc20733a0
800
PASSED
#include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; int a[n]; if(n==4) cout<<2<<" "<<1<<" "<<3<<" "<<4<<endl; else ...
C++
9cc18b914678cb18213b2a52259de35d
166e4e06868e33bae4363c67777c14b4
800
PASSED
#include<iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppppppppppppppp"<<nd; #de...
C++
67dd049fafc464fed87fbd23f0ccc8ab
e8ea7491f28ac7a3fdfaa17667d07671
2,300
PASSED
#include<iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppppppppppppppp"<<nd; #de...
C++
67dd049fafc464fed87fbd23f0ccc8ab
40d01ba7a431ef26faffef6903ab79ef
2,300
PASSED
#include<iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppppppppppppppp"<<nd; #de...
C++
67dd049fafc464fed87fbd23f0ccc8ab
b04e4505efd8fbe99c7ae5c2f989a6bb
2,300
PASSED
#include<iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppppppppppppppp"<<nd; #de...
C++
67dd049fafc464fed87fbd23f0ccc8ab
af29fd45efaf10da0470fe9716ca63e7
2,300
PASSED
#include<iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppppppppppppppp"<<nd; #de...
C++
67dd049fafc464fed87fbd23f0ccc8ab
beb32ab65828b0b3367645adc4dee0b2
2,300
PASSED
// الله العزه #include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; ...
C++
67dd049fafc464fed87fbd23f0ccc8ab
1743c214f307a583859bbb0f09792773
2,300
PASSED
// الله العزه #include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; ...
C++
67dd049fafc464fed87fbd23f0ccc8ab
70418ca66959fba4692fb315799419ef
2,300
PASSED
// الله العزه #include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; ...
C++
67dd049fafc464fed87fbd23f0ccc8ab
b1da28f8fca20425a036b59a90815fb0
2,300
PASSED
// الله العزه #include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppp...
C++
67dd049fafc464fed87fbd23f0ccc8ab
685258f22e5939f343e96546b82d37fd
2,300
PASSED
// الله العزه #include <iostream> #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define nd "\n" #define all(x) (x).begin(), (x).end() #define lol cout <<"i am here"<<nd; #define py cout <<"YES"<<nd; #define pp cout <<"ppppp...
C++
67dd049fafc464fed87fbd23f0ccc8ab
10a1b3b3559519379cf8dd3a42baaaaf
2,300
PASSED
#include <bits/stdc++.h> using namespace std; const uint64_t seed = std::chrono::system_clock::now().time_since_epoch().count(); mt19937_64 rnd(seed); const char NL = '\n'; using LL = long long; #ifdef VIPJML_LOCAL #include <vipjml_debug.hpp> #else #define dbg(...) #endif template <long long MOD = 998244353> struct Mi...
C++
33ad21c1e922b8a2aba774fe54baf06a
bf5c7f0d6f2cd719c953934d929e2106
2,700
PASSED
#include <bits/stdc++.h> using namespace std; const uint64_t seed = std::chrono::system_clock::now().time_since_epoch().count(); mt19937_64 rnd(seed); const char NL = '\n'; using LL = long long; #ifdef VIPJML_LOCAL #include <vipjml_debug.hpp> #else #define dbg(...) #endif template <long long MOD = 998244353> struct Mi...
C++
33ad21c1e922b8a2aba774fe54baf06a
dff5202a646afcd97e4d8f0e5388ff4c
2,700
PASSED
#include <bits/stdc++.h> #ifdef ALGO #include "el_psy_congroo.hpp" #else #define DUMP(...) #define PLOT(...) #define CHECK(...) #endif namespace { using LL = long long; template<typename T, typename U> bool enlarge(T& a, U b) { \ return a < b ? (a = b, true) : false; } template<typename T, typename U> bool minify(T...
C++
33ad21c1e922b8a2aba774fe54baf06a
dcf54a566c92f41b4e8e93f878a1df1a
2,700
PASSED
// ~Be name khoda~ // #include<bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define fi first #define se second const int maxn = 1e6 + 10; const int maxn5 = 2e5 + 10; const int maxnt = 1.2e6 ...
C++
33ad21c1e922b8a2aba774fe54baf06a
d1e9a3d299cd20c2745fb393d4b35e9c
2,700
PASSED
// ~Be name khoda~ // #include<bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define fi first #define se second const int maxn = 1e6 + 10; const int maxn5 = 2e5 + 10; const int maxnt = 1.2e6 ...
C++
33ad21c1e922b8a2aba774fe54baf06a
a44cf0dab727e3414480666feedea4e5
2,700
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define M 998244353 #define b(x) (1<<((x)-1)) int i,j,k,n,m,t,a[300005],p[999],d; int inv[1005000]; ll ksm(ll a,int p){ll res=1;while(p){if(p&1){res=res*a%M;}a=a*a%M;p>>=1;}return res;} int su(int a,int b){a+=b;return (a>=M)?a-M:a;} int f[10...
C++
33ad21c1e922b8a2aba774fe54baf06a
ae32e09a098d18b863198529da75a559
2,700
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define M 998244353 #define b(x) (1<<((x)-1)) int i,j,k,n,m,t,a[300005],p[999],d; int inv[1005000]; ll ksm(ll a,int p){ll res=1;while(p){if(p&1){res=res*a%M;}a=a*a%M;p>>=1;}return res;} int su(int a,int b){a+=b;return (a>=M)?a-M:a;} int f[10...
C++
33ad21c1e922b8a2aba774fe54baf06a
ff11349d01edc2d70c7b02dd9f0997f6
2,700
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define M 998244353 #define b(x) (1<<((x)-1)) int i,j,k,n,m,t,a[300005],p[999],d; int inv[1005000]; ll ksm(ll a,int p){ll res=1;while(p){if(p&1){res=res*a%M;}a=a*a%M;p>>=1;}return res;} int su(int a,int b){a+=b;return (a>=M)?a-M:a;} int f[10...
C++
33ad21c1e922b8a2aba774fe54baf06a
bcdad98b80207b5cf2422d95e3d3d839
2,700
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define M 998244353 #define b(x) (1<<((x)-1)) int i,j,k,n,m,t,a[300005],p[999],d; int inv[1005000]; ll ksm(ll a,int p){ll res=1;while(p){if(p&1){res=res*a%M;}a=a*a%M;p>>=1;}return res;} int su(int a,int b){a+=b;return (a>=M)?a-M:a;} int f[10...
C++
33ad21c1e922b8a2aba774fe54baf06a
521583909020820f7e0d1ee65e52148b
2,700
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define M 998244353 #define b(x) (1<<((x)-1)) int i,j,k,n,m,t,a[300005],p[999],d; int inv[1005000]; ll ksm(ll a,int p){ll res=1;while(p){if(p&1){res=res*a%M;}a=a*a%M;p>>=1;}return res;} int su(int a,int b){a+=b;return (a>=M)?a-M:a;} int f[10...
C++
33ad21c1e922b8a2aba774fe54baf06a
f8a7ea15273d9ac1706ec8304d30f906
2,700
PASSED
#include <bits/stdc++.h> using namespace std; // Using long long instead of int to avoid overflow // defines to reduce typing #define ll long long #define pb push_back #define mp make_pair #define fi first #define se second #define all(x) (x).begin(), (x).end() #define rev(x) (x).rbegin(), (x).rend() #de...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
e92e28d76e571412000ab77c053222a9
3,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int N = 1005, M = 1000005; int match[N]; bool used[N]; vector<int> adj[M]; bool DFS(int x) { for(auto u : adj[x]) { if(used[u]) continue; used[u] = true; int next = match[u]; if(next == -1 || DFS(next)) { ...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
8123c7447fba2dcef5f624e2b34e2367
3,100
PASSED
#include <bits/stdc++.h> #ifdef LOCAL_T4M0FEY #include "debug.h" #else #define debug(x...) 228 #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define fi first #define se second const int inf = int(1e9) + 1; const ll infll = ll(1e18) + 1; ...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
dc38b9ba62046c2516df91a566112bfb
3,100
PASSED
#include <bits/stdc++.h> #ifdef LOCAL_T4M0FEY #include "debug.h" #else #define debug(x...) 228 #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define fi first #define se second const int inf = int(1e9) + 1; const ll infll = ll(1e18) + 1; ...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
a70f2c3d0ae42e96676dc0e9c2298c2b
3,100
PASSED
#include <bits/stdc++.h> #ifdef LOCAL_T4M0FEY #include "debug.h" #else #define debug(x...) 228 #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define fi first #define se second const int inf = int(1e9) + 1; const ll infll = ll(1e18) + 1; ...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
5054c09a7418d82404480dc69f5f5363
3,100
PASSED
#include <bits/stdc++.h> #ifdef LOCAL_T4M0FEY #include "debug.h" #else #define debug(x...) 228 #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define fi first #define se second const int inf = int(1e9) + 1; const ll infll = ll(1e18) + 1; ...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
211d67390c29109888f10be811ec3ec3
3,100
PASSED
#include <bits/stdc++.h> #ifdef LOCAL_T4M0FEY #include "debug.h" #else #define debug(x...) 228 #endif using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define fi first #define se second const int inf = int(1e9) + 1; const ll infll = ll(1e18) + 1; ...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
386c6c70bd375c7231d32c88f8b2442c
3,100
PASSED
#include<cmath> #include<vector> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define mp make_pair #define pb push_back #define LL long long // #define int long long // #define pil pair<int,LL> using namespace std; const int N=1001000+50;LL inf=1e18; int n1,n2,mat[N],vis[N],clk...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
05938534e1bfb9ec7d2e54792c9d0b05
3,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define inf 0x3f3f3f3f3f3f3f3fll int main() { const int mod = 998244353; // ios::sync_with_stdio(false); // cin.tie(0); // cout.tie(0); int n; cin >> n; vector<vector<int>> to(n * n); int tot = 0; map<int, int> id; fo...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
21e122601240551cc696ba18134fdf24
3,100
PASSED
#include <bits/stdc++.h> #define INF 1000000007 using namespace std; int n,a[1010],f[1010][1010],vis[1010],h[1010],g[1000010]; inline int dfs1(int x) { vis[x]=1; int minv=INF,now=0; for(int i=1;i<=n;i++){ int u=f[x][i],p; if(!g[u]) p=u; else if(!vis[g[u]]) p=dfs1(g[u]); else p=INF; if(p<mi...
C++
22a7d097ff4d77d74b2e058f34b4d4e1
d876cf00898ceaafea72f15ff1545c01
3,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; signed main() { cin.tie(NULL)->sync_with_stdio(false); ll t; cin >> t; while (t--) { int n; cin >> n; int ans = 1e9; map<int, int> a, b; for (int i = 1; i <= n; i++) ...
C++
aab052bf49da6528641f655342fa4848
afc7c14f3bb204c02f379bcb0985e7eb
1,500
PASSED
#include <bits/stdc++.h> using namespace std ; #define ll long long #define no cout <<"NO"<<endl #define yes cout <<"YES"<<endl #define fast ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); int main() { fast // #ifndef ONLINE_JUDGE // freopen("in.txt", "r", stdin); // #endif ll tc = 1; c...
C++
aab052bf49da6528641f655342fa4848
38ebf22a4ea8dde228e053989dfac459
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define f(i,l,r) for(int i=l;i<(int)r;i++) const int N = 2e5 + 5; int n; inline void solve() { cin >> n; unordered_map<int, int> mt; for (int i = 1, t; i <= n; i++) cin >> t, mt[t]++; if (mt.size() == n) cout << 0 << '\n'; else { set<int> st; for (auto & [x, y] :...
C++
aab052bf49da6528641f655342fa4848
5e2774e4c00dd97c79cdfb9898771088
1,500
PASSED
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define all(vec) vec.begin(), vec.end() #define cin(v) for (auto& i : v) cin >> i #define cout(v) for (auto& i : v) cout << i << " "; cout << endl #define Ceil(a, b) ((a / b) + (a % b ? 1 : 0)) #define mod 1000000007 #define fr first #define ...
C++
aab052bf49da6528641f655342fa4848
4c91c08f55109685bd7d5dfe04839eb7
1,500
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 3e5 + 5, mod = 1e9 + 7; const ll oo = 1e18; ll a[N]; void solve() { int n; cin>>n; map<int,int>cnt; for(int i=0;i<n;i++){ cin>>a[i]; cnt[a[i]]++; } vector<int>v; for(aut...
C++
aab052bf49da6528641f655342fa4848
ff1a7ba2284e7c9ad84a9c4ace5b036e
1,500
PASSED
// Author : Belal Moawad #include<bits/stdc++.h> #include<ext/numeric> #define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); using namespace std; using namespace __gnu_cxx; #define int long long #define ll long long #define double long double #define F first #define S second typedef vector<int> vi; typede...
C++
aab052bf49da6528641f655342fa4848
a65cf10c43c9066e24cb5045eeb32f2e
1,500
PASSED
// Author : Belal Moawad #include<bits/stdc++.h> #include<ext/numeric> #define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); using namespace std; using namespace __gnu_cxx; #define int long long #define ll long long #define double long double #define F first #define S second typedef vector<int> vi; typede...
C++
aab052bf49da6528641f655342fa4848
f65123a9e78e183175d60f99a9dd1eb0
1,500
PASSED
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(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, cur, ans; cin >> t; while (t--) { ans = INT_MAX; cin >> n; m...
C++
aab052bf49da6528641f655342fa4848
65d0d773184440800beca1a5b1405391
1,500
PASSED
#pragma GCC optimize ("O3") #include <bits/stdc++.h> using namespace std; #define int long long #define printv(x) for(int i : x) cout << i << " "; cout << endl; #define fl(x) for(int i = 0 ; i < x.size(); i++ ) #define yes cout << "YES" << endl; #define no cout << "NO" << endl void solve() { int n ; cin >> ...
C++
aab052bf49da6528641f655342fa4848
cf77eaea706a8e2ea556d44067d998f3
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define el "\n" using ll = long long; int main() { int t; cin >> t; while (t--) { map<int, int> freq1, freq2; int n; cin >> n; int a[n + 2]; for(int i = 0; i < n; i++) { cin >> a[i]; freq1[a[i]]++; ...
C++
aab052bf49da6528641f655342fa4848
832068a511b785c34e79d48c81451517
1,500
PASSED
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<iomanip> #include<cmath> #include<queue> #include<stack> #include<map> #include<unordered_map> #include<cctype> #include<set> #include<unordered_set> #include<cstring> #include<numeric> #include<limits> #include<limits.h> using namespace ...
C++
debce043777e7e575f77a94edf89c7f1
946f5fa55bed5f227068e0010dd60bd5
1,400
PASSED
#include <bits/stdc++.h> #define ll long long #define FIO ios_base::sync_with_stdio(false), cout.tie(nullptr); cin.tie(nullptr); using namespace std; const int N = 1e9+7; const ll mod = 1e9+7; int n, m; int main(){ FIO int t; cin>>t; while(t--){ int n; cin>>n; pair<int, int>a...
C++
debce043777e7e575f77a94edf89c7f1
c183c083a23dfe30157535f6cbeb3788
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define debug(x) cerr << (#x) << " = " << x << endl const int N = 2e5 + 10; int n, m, k; int a[N], s[N]; struct node { int x, p; bool operator < (const node &s) const { return x < s.x; } } v[N]; void solve(int test_i) { cin >> ...
C++
debce043777e7e575f77a94edf89c7f1
9e1cb57a20f23116970086498a66f8b4
1,400
PASSED
#include<bits/stdc++.h> #include<string.h> #include<cmath> #include<algorithm> #define max(a,b) ((a)>(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b)) using namespace std; const int MAXN=2e6+5; const int p=5005; typedef long long ll; typedef struct node{ ll val; int idx; bool pd; }nodes; bool comp1(nodes x,nodes y){ ...
C++
debce043777e7e575f77a94edf89c7f1
85ec19cdbdf48df2dfb53fa545ac929f
1,400
PASSED
#include <bits/stdc++.h> #define int long long using namespace std; int ans,n,sm[200005],dp[200005]; pair<int,int>v[200005]; void solve() { cin >> n; for(int i = 1;i <= n; ++i) cin >> v[i].first,v[i].second = i,dp[i] = 0; v[n+1].first = 0; sort(v+1,v+1+n); for(int i = 1;i <= n; ++i) sm[i] = ...
C++
debce043777e7e575f77a94edf89c7f1
91142280ebddf6f2052c0b927ca5cfa5
1,400
PASSED
#include <iostream> #include <queue> #include <stack> #include <algorithm> #include<cstdio> #include<vector> #include<set> #include<map> #include<string> #include<cmath> #define ll long long using namespace std; int main() { int t; cin>>t; while(t--){ int n; cin>>n; vector<pair<int,int> >ans(n); for(int i=0...
C++
debce043777e7e575f77a94edf89c7f1
facbdc0e5e4783fb3b9d328dded3e24b
1,400
PASSED
#include<iostream> #include<algorithm> #include<stdlib.h> #include<vector> #include<queue> #include<stack> #include<map> #include<unordered_map> #include<set> #include<cmath> #include<algorithm> #include<cstring> #include<iomanip> #define ll long long #define P pair<int,int> #define PI acos(-1) #define lowbit(x) (x&(-x...
C++
debce043777e7e575f77a94edf89c7f1
aa3f3a8b09e099aea86db319bb7333b7
1,400
PASSED
/* */ #include<bits/stdc++.h> using namespace std; #define AC ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define LL long long struct Player { LL idx, value, prefix = 0; }; bool compare(const Player &a, const Player &b){ return a.value < b.value; } void solve(){ int n; cin >> n; vector < Pla...
C++
debce043777e7e575f77a94edf89c7f1
4cf8fd8353887608bdcbb953ce8121a5
1,400
PASSED
#include <algorithm> #include <iostream> #include <string.h> #include <cstring> #include <vector> #include <cstdio> #include <queue> #include <cmath> #include <map> #include <set> #define sf scanf #define fi first #define endl '\n' #define se second #define pf printf using namespace std; #define LL long long #define pb...
C++
debce043777e7e575f77a94edf89c7f1
5d6144986457b63be2673b957c6ac2dc
1,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5+10; int st[N]; struct ss{ int x; int y; }; bool cmp(ss u,ss v){ return u.y<v.y; } void solve() { int n,m; cin >> n; ss a[n]; LL ans = 0; memset(st,0,n+1); for(int i=0;i<n;i++){ cin >> m; ...
C++
debce043777e7e575f77a94edf89c7f1
55e6ded6e5ada3f05931e92d311a67e9
1,400
PASSED
import java.util.ArrayList; import java.util.Scanner; //main class public class Main { public static int findMax(int arr[],int a,int b) { int max=0; int idx=-1; for(int i=a;i<=b;i++) { if(arr[i]>max) { max=arr[i]; idx=i; } } return idx; } public static node buildTree(int arr[],int a,int b,in...
Java
a564017f9c411b39f8d4b69e629ae3bc
b52d9531d4573e700067087c94e5557c
1,200
PASSED