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; const int maxN = 4e5+100; int n, m, ans, cnt_lt, cnt, N1, N2; int a[maxN], num[maxN], low[maxN], id[maxN], deg[maxN]; string c[maxN]; vector<int> d[maxN]; const int di[4]={-1, 0, 1, 0}, dj[4]={0, -1, 0, 1}; vector<int> e[maxN], e2[maxN]; set<int> Q; vector<int> ...
C++
7030441bd7f8f34b007f959698f4739d
0ddcf8b6fc6c2c08c5c0912b86068cad
2,500
PASSED
#include <cstdio> #include <vector> using namespace std; int Abs (int x) { return x < 0 ? -x : x; } int Max (int x, int y) { return x > y ? x : y; } int Min (int x, int y) { return x < y ? x : y; } int Read () { int x = 0, k = 1; char s = getchar (); while (s < '0' || s > '9') { if (s ...
C++
7030441bd7f8f34b007f959698f4739d
dfb1f799fa631f58a25a15cae2630d4d
2,500
PASSED
#include <bits/stdc++.h> #define BPhuong "main" #define maxn 400009 #define fi(i, a, b) for(int i = a; i <= b; i++) #define fid(i, a, b) for(int i = a; i >= b; i--) #define pb push_back #define pii pair<int, int> #define f first #define se second using namespace std; int n, m; int f[maxn], cl[maxn], xd[max...
C++
7030441bd7f8f34b007f959698f4739d
32bde1a0e3054afba9e4b7f6efd32c7e
2,500
PASSED
#include<iostream> #include<cstdio> #include<vector> #include<queue> #include<stack> using namespace std; int n,m,bin[400001],d[400001],ans,dfn[400001],low[400001],cnt,col[400001],num; vector<char> v[400001]; vector<int> g[400001]; stack<int> t; bool vis[400001],inq[400001]; inline int anc(int k) { if(...
C++
7030441bd7f8f34b007f959698f4739d
e30f856fe84a10c7fcdf7adab0d7b5c4
2,500
PASSED
#include<iostream> #include<cstdio> #include<vector> #include<queue> #include<stack> using namespace std; int n,m,bin[400001],d[400001],ans,dfn[400001],low[400001],cnt,col[400001],num; vector<char> v[400001]; vector<int> g[400001]; stack<int> t; bool vis[400001],inq[400001]; inline int anc(int k) { if(...
C++
7030441bd7f8f34b007f959698f4739d
ef4d0b03ecc314585477c9c411d6f9d7
2,500
PASSED
//#include<cstdio> //#include<cassert> //#include<iostream> //#include<cstring> //#include<algorithm> #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define MAX ((int)2e9 + 5) #define MAXP ((int)1e5 + 5) #define MAXL ((ll)1e18 + 5) #define MAX_X ((int)2001...
C++
7030441bd7f8f34b007f959698f4739d
91b7d0824f7894872429df3a5fa4684c
2,500
PASSED
#include<bits/stdc++.h> #define Cn const #define CI Cn int& #define N 800000 #define LL long long using namespace std; namespace FastIO { #define FS 100000 #define Tp template<typename Ty> #define Ts template<typename Ty,typename... Ar> #define tc() (FA==FB&&(FB=(FA=FI)+fread(FI,1,FS,stdin),FA==FB)?EOF:*...
C++
2df96204e085fb8c28f56b6ffddc0714
98424437e66da0594c929feb66b655f8
3,300
PASSED
/*input 10 1 1 2 2 2 0 4 2 4 0 2 0 0 2 4 0 4 2 5 1 */ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; //#pragma GCC optimize("unroll-loops,no-stack-protector") //order_of_key #of elements les...
C++
2df96204e085fb8c28f56b6ffddc0714
a68107d5c110513e1921d4628c0f5b5b
3,300
PASSED
/*input 10 1 1 2 2 2 0 4 2 4 0 2 0 0 2 4 0 4 2 5 1 */ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; //#pragma GCC optimize("unroll-loops,no-stack-protector") //order_of_key #of elements les...
C++
2df96204e085fb8c28f56b6ffddc0714
930373a55215d4ac03ab85a15c8a714b
3,300
PASSED
/*input 10 1 1 2 2 2 0 4 2 4 0 2 0 0 2 4 0 4 2 5 1 */ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; //#pragma GCC optimize("unroll-loops,no-stack-protector") //order_of_key #of elements les...
C++
2df96204e085fb8c28f56b6ffddc0714
1b34a33fb4fefd5941f616e41d85261e
3,300
PASSED
#include <set> #include <cstdio> #include <algorithm> typedef long long ll; const int maxn = 8e5+5; struct Set{ std :: multiset<ll> s;ll tg; void ins(int x){s.insert(x-tg);} void del(int x){s.erase(s.find(x-tg));} ll mn(){return *s.begin()+tg;} ll mx(){return *(--s.end())+tg;} }L,R; struct Pt{int x,y;}...
C++
2df96204e085fb8c28f56b6ffddc0714
430a1daced2b6c7cb096cfdfec39fbc3
3,300
PASSED
#include <set> #include <cstdio> #include <algorithm> typedef long long ll; const int maxn = 8e5+5; struct Set{ std :: multiset<ll> s;ll tg; void ins(int x){s.insert(x-tg);} void del(int x){s.erase(s.find(x-tg));} ll mn(){return *s.begin()+tg;} ll mx(){return *(--s.end())+tg;} }L,R; struct Pt{int x,y;}...
C++
2df96204e085fb8c28f56b6ffddc0714
3eff4656ef9249ddf3f1be65498e3b90
3,300
PASSED
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <...
C++
2df96204e085fb8c28f56b6ffddc0714
942a260adf4cac093f80294533cf835a
3,300
PASSED
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <...
C++
2df96204e085fb8c28f56b6ffddc0714
aff10a9618c45be9c986793fb54de5c6
3,300
PASSED
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <...
C++
2df96204e085fb8c28f56b6ffddc0714
b8ffc71e7649a62bc9c5a482130be5f4
3,300
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 800003; int n; pair<LL, LL> p[N]; priority_queue<LL> pq1, pq2; LL ans; int main(){ ios::sync_with_stdio(0); cin >> n; for(int i = 1;i <= n;++ i){ cin >> p[i].first >> p[i].second; p[i].first += p[i].second; } sort(p...
C++
2df96204e085fb8c28f56b6ffddc0714
0dec64ad6ffcd847f1681160126eef0b
3,300
PASSED
#include <bits/stdc++.h> using namespace std; int solve(int n, int m){ if(m % 3 == 0)return (m / 3) * n; else if(m % 3 == 1){ return (m / 2) * n; } else{ return min((m / 2) * n,((m / 3) + 1) * n); } } int main() { int t; cin >> t; while(t--){ int n...
C++
70a0b98f2bb12990a0fa46aaf13134af
3a5917088103bcc068dc22639d7bfdcd
1,000
PASSED
#include<iostream> #include<stdio.h> #include<string.h> #include<string> #include<algorithm> #include<math.h> using namespace std; int main() { int t; scanf("%d",&t); while(t--){ long long x,y; scanf("%lld%lld",&x,&y); if(x*y%3==0&&x*y>=3){ printf("%lld\n",x*y/3); } else printf("%lld\n",x*y/3+1); } re...
C++
70a0b98f2bb12990a0fa46aaf13134af
6d48f77b7718af37a87c4b833c1efb33
1,000
PASSED
#include<iostream> #include<algorithm> using namespace std; int main(){ int t; cin >> t; while(t--){ int n,m; cin >> n >> m; int ans=0; if(n>=3){ ans+=n/3*m; n%=3; } if(n==2){ ans+=2*(m/3)+m%3; n%=2; } if(n==1){ ans+=m/3; if(m%3) ans++; n%=1; } cout << ans << endl; } re...
C++
70a0b98f2bb12990a0fa46aaf13134af
6e6f9b34de2a45320e66107ec52b0ba7
1,000
PASSED
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main(){ int t; scanf("%d",&t); while(t--){ int n,m; scanf("%d%d",&n,&m); int ans=0; ans+=((n/3)*m); n%=3; ans+=((m/3)*n); m%=3; if(n==0||m==0) printf("%d\n",ans); else if(n==1||m==1) printf("%d\n",ans+1); else printf...
C++
70a0b98f2bb12990a0fa46aaf13134af
be530c3e5063a70b4569c2078b4db11d
1,000
PASSED
#include <bits/stdc++.h> #include <string> using namespace std; #define pb push_back #define F first #define S second #define rep(i,n) for(int i = 0; i < (n); i++) #define input freopen("input.in","r",stdin) #define output freopen("output.out","w",stdout) #define ordered_set tree<int, ...
C++
70a0b98f2bb12990a0fa46aaf13134af
9903a234bd4372e014ecd30628c6cc86
1,000
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl '\n' #define WHILE \ { \ int t; \ cin >> t; \ while (t--) solve(); \ } #define INF 0x3f3f3f3f const int N = 1e6 + 10; int n, m; void solve() { cin >> n >> m; ll...
C++
70a0b98f2bb12990a0fa46aaf13134af
c9d9f69384377c4bd1252e36b5d5cd4a
1,000
PASSED
#include <iostream> #include <algorithm> using namespace std; #define ll long long int main() { int t; cin >> t; while (t--) { ll x, y; cin >> x >> y; if (x % 3 == 0) { cout << y * (x / 3) << "\n"; continue; } if (y % 3 == 0) { cout << x * (y / 3) << "\n"; continue; } ll ans = 0; i...
C++
70a0b98f2bb12990a0fa46aaf13134af
53d4a27e42bc91a608024301c22c3a18
1,000
PASSED
#include<bits/stdc++.h> #define pb push_back #define mp make_pair #define pf printf #define ff first #define ss second #define sef second.first #define ses second.second #define PI 3.14159265 /// tan inverse = atan(value)*(180/PI) #define ms(a,b) memset(a, b, sizeof(a)) #define lp(i,a,b)...
C++
70a0b98f2bb12990a0fa46aaf13134af
8a702962b5a1c4cd05434c3e7c492631
1,000
PASSED
# include<bits/stdc++.h> using namespace std; #define OmarHafez ios_base::sync_with_stdio(0), cin.tie(0); #define ll long long const int N=1e4+5,WE=1e5+5; int main() { int test; cin>>test; while(test--) { int rows,cols,res=0; cin>>rows>>cols; int rest=cols%3; if(rest==0)res+=(col...
C++
70a0b98f2bb12990a0fa46aaf13134af
86a6744074e27d8b8a44937bdaf0412b
1,000
PASSED
#include<iostream> #include<algorithm> using namespace std; int main() { int t,n,m; cin >> t; for (int i = 0; i < t; i++) { cin >> n >> m; int t1, t2,t; t = n * m; if (t % 3 == 0) t1 = t / 3; else t1 = t / 3 + 1; cout << t1 << endl; } }
C++
70a0b98f2bb12990a0fa46aaf13134af
81edafb9c026134a2998b06533cd0dba
1,000
PASSED
#include<bits/stdc++.h> using namespace std; int t, n; int a[105]={0}, b[105]={0}, d[105]; int main() { cin>>t; while(t--){ cin >> n; fill(a, a + n, 0); fill(b, b + n, 0); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n; i++)...
C++
6ca98e655007bfb86f1039c9f096557e
d4c3c102f7c1d7045bd6af01eb2cc576
900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int t; cin>>t; while(t--) { int n; int a[210]={0},b[210]={0},x; cin>>n; for(int i=0;i<n;i++)cin>>x,a[x+102]++; for(int i=0;i<n;i++)cin>>x,b[x+102]++; ll sum=0; ...
C++
6ca98e655007bfb86f1039c9f096557e
364667331654c8dd0fa74d6cbe6d6d4d
900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl '\n' const ll CF = 2e5 + 9; #define buff ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); ll t, n; ll ok = 1; ll a[CF], b[CF]; int main() { cin >> t; while (t--) { ok = 1; scanf("%lld", &n); ...
C++
6ca98e655007bfb86f1039c9f096557e
11ec5764fb96c15577773b9aea844d30
900
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; const ll mod = 7, inf = 1e18; const int N = 1000, M = 2010; int n; vector<int>va, vb; map<int, int>ff; int x; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int t; cin >> t; while (t--) { cin >> n; ...
C++
6ca98e655007bfb86f1039c9f096557e
14c7b199cc5998972d359d11d3fbd28a
900
PASSED
#include<bits/stdc++.h> using namespace std; int a[110]; int b[110]; int main(){ int _; scanf("%d",&_); while(_--){ int n; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) scanf("%d",&b[i]); sort(a+1,a+n+1); sort(b+1,b+n+1); bool f=false; for(int i=1;i<=n;i++){ if(b[i...
C++
6ca98e655007bfb86f1039c9f096557e
cadcb679fff1ad0b3caf38ec795895a1
900
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define ls rt<<1 #define rs (rt<<1)|1 const int N=100+5; int a[N],b[N],n; void solve(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++) cin>>b[i]; sort(a+1,a+n+1); sort(b+1,b+n+1); for(int i=1;i<=n;i++){ if...
C++
6ca98e655007bfb86f1039c9f096557e
02ad504e8d5a53fd4af8f1de65b0db4e
900
PASSED
#include<bits/stdc++.h> /* Writher:ZhengZhiLin Time:2022-09-06-25 */ #define int long long #define for1(i,a) for(int i=0; i<a ; i++) #define for2(i,a,b) for(int i=a; i<b ; i++) #define for3(i,a,b,c) for(int i=a; i<b ;i+=c) #define len(x) ll(x.size()) int lowbit(int x) {return x & (-x);} inline int r() { int X=0; boo...
C++
6ca98e655007bfb86f1039c9f096557e
e7b6d2a32db2040dde783c7933d498e6
900
PASSED
#include<bits/stdc++.h> using namespace std; //#define DEBUG typedef long long ll; const int N=2e5+3; int a[N],b[N]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #ifdef DEBUG ifstream cin; ofstream cout; cin.open("1.in"); cout.open("2.out"); #endif int T,n; cin>>T; ...
C++
6ca98e655007bfb86f1039c9f096557e
a94f305108fd310d636bc8643e0a5b13
900
PASSED
#include<bits/stdc++.h> using namespace std; int T,n,a[111],b[111]; void doing(){ cin>>n; for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) scanf("%d",&b[i]); sort(a+1,a+n+1); sort(b+1,b+n+1); for(int i=1;i<=n;i++) if(a[i]!=b[i]&&a[i]+1!=b[i]) return printf("nO\n"),void(); printf("yEs\n"); } int mai...
C++
6ca98e655007bfb86f1039c9f096557e
c1883d398d9f3a4bde096dcca4e4415d
900
PASSED
#include <bits/stdc++.h> #define L (T[rt].l) #define R (T[rt].r) #define Mid (T[rt].l + T[rt].r >> 1) #define ls (rt<<1) #define rs (rt<<1+1) #define Lazy (T[rt].lazy) using namespace std; typedef long long ll; typedef pair<int,int> pir; const double pi = acos(-1); const ll inf = (long long)1e18; const int N = 1e5+10;...
C++
6ca98e655007bfb86f1039c9f096557e
c1b55a423a0a63c4c084df629155977a
900
PASSED
#include <bits/stdc++.h> using namespace std ; #define int long long #define lower(s) transform(s.begin(),s.end(),s.begin(),::tolower) #define upper(s) transform(s.begin(),s.end(),s.begin(),::toupper) #define a2d vector<vector<int>>a(n, vector<int>(m)); #define endl "\n" #define nostring string::npos #defin...
C++
4dfa99acbe06b314f0f0b934237c66f3
8655698cb62907bef128676074bf27a0
800
PASSED
#include<iostream> #include<cmath> using namespace std; void solve() { long long int a,b; cin>>a>>b; cout<<-a*a<<" "<<b*b<<endl; } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int t; cin>>t; while(t--) ...
C++
4dfa99acbe06b314f0f0b934237c66f3
c0a0823ed64be1e467eed51cbe27407a
800
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout); #define tt int tc; cin>>tc; while(tc--) #define nl cout<<"\n"; #define sp cout<<" "; #define yes co...
C++
4dfa99acbe06b314f0f0b934237c66f3
0858352bbc9fc996abb9ae1f368fc5e7
800
PASSED
#include<bits/stdc++.h> using namespace std; long long u,v; int main(){ int tt; cin>>tt; while (tt--){ cin>>u>>v; cout<<-u*u<<" "<<v*v<<endl; } return 0; }
C++
4dfa99acbe06b314f0f0b934237c66f3
07b5edb7aeb06cefd0ae7bcc6db10e26
800
PASSED
#include<cstdio> #include<iostream> #include<algorithm> #include<queue> #include<vector> #include<string> #include<cstring> #include<stack> #include<cmath> #include<map> #define Inf 0x3f3f3f3f #define MAXX 1000005 using namespace std; typedef pair<int,int> P; typedef long long LL; LL u,v; void solve_it(){ scanf("%ll...
C++
4dfa99acbe06b314f0f0b934237c66f3
8ef5c28f7c8be3cf40873150596bc404
800
PASSED
#include <iostream> #include <map> using namespace std; typedef long long ll; void solve(){ ll u,v; cin>>u>>v; cout<<(-u)*u<<' '<<v*v<<endl; } int main(){ int t; cin>>t; while(t--)solve(); return 0; }
C++
4dfa99acbe06b314f0f0b934237c66f3
75d414fd23500d0ab3838c7d1daa5224
800
PASSED
#include <iostream> using namespace std; typedef long long ll; int main() { cin.tie(NULL)->sync_with_stdio(false); int countOfTestCases; cin >> countOfTestCases; for (int i = 0; i < countOfTestCases; i++) { ll u, v; cin >> u >> v; cout << -(u * u) << " " << v * v << "\n"; } return 0; } ...
C++
4dfa99acbe06b314f0f0b934237c66f3
649dc66972357dde02d78cf5e21d2df0
800
PASSED
#include<bits/stdc++.h> #define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); #define _ << " " << #define ff first #define ss second #define ll long long #define pb push_back using namespace std; //int mx[ ] = {-1, 0, 1, 0, 1, 1, -1, -1}; //int my[ ] = {0, 1, 0, -1, 1, -1,-1, 1}; int main () { ...
C++
4dfa99acbe06b314f0f0b934237c66f3
7e9bfc8aac4f0b9451f40d8101e3e1c9
800
PASSED
#include <iostream> #include <stdio.h> using namespace std; int main() { int t; scanf("%d", &t); long long u, v; for (int q = 0; q < t; q++) { scanf("%lld%lld", &u, &v); if (u == v) { printf("-1 1\n"); } else { printf("%lld %lld\n", -(u * u), v * v); ...
C++
4dfa99acbe06b314f0f0b934237c66f3
d6fb39201e80645aafa37585a4d95d77
800
PASSED
#include<stack> #include<cstdlib> #include<cstdio> #include<algorithm> #include<cmath> #include<queue> #include<cstring> #include<deque> #include<vector> #include<iostream> #include<map> #include<unordered_map> #include<set> #include<iomanip> #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll lo...
C++
4dfa99acbe06b314f0f0b934237c66f3
87b8a215d93b8e4ed305ebc3e86c3d58
800
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long using namespace std; using namespace __gnu_pbds; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> order_set; #pragma GCC optimize("Ofast") #pragm...
C++
e9065e8bd9afb7d797527bc3a50f2150
684105ad7f49a0f7373922d855af20f0
2,300
PASSED
#include <iostream> #include <cstdio> #include <string> #include <unordered_map> #include <map> #include <set> #include<cmath> #include <unordered_set> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> using ll = long long; using namespace std; const ll N = 31234...
C++
e9065e8bd9afb7d797527bc3a50f2150
4ba62602893b197cf6b15fdbf417fcc3
2,300
PASSED
#include <bits/stdc++.h> #pragma optimize(3, "-Ofast", "inline") using namespace std; #define ios_fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define lld long double #define mp make_pair #define me(a, b) memset(a, (ll)(b...
C++
e9065e8bd9afb7d797527bc3a50f2150
325d3a424b71204fb4a36036bcccdbd4
2,300
PASSED
#include <bits/stdc++.h> #pragma optimize(3, "-Ofast", "inline") using namespace std; #define ios_fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define lld long double #define mp make_pair #define me(a, b) memset(a, (ll)(b...
C++
e9065e8bd9afb7d797527bc3a50f2150
5dc12c1eb0233de22a70575dc606c3b8
2,300
PASSED
#include <bits/stdc++.h> #pragma optimize(3, "-Ofast", "inline") using namespace std; #define ios_fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define lld long double #define mp make_pair #define me(a, b) memset(a, (ll)(b...
C++
e9065e8bd9afb7d797527bc3a50f2150
acf300335183158f9e41bcb54592fde9
2,300
PASSED
#include <bits/stdc++.h> #pragma optimize(3, "-Ofast", "inline") using namespace std; #define ios_fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define lld long double #define mp make_pair #define me(a, b) memset(a, (ll)(b...
C++
e9065e8bd9afb7d797527bc3a50f2150
1dc678e2f355cbd83401d22a30c379de
2,300
PASSED
#include <bits/stdc++.h> #pragma optimize(3, "-Ofast", "inline") using namespace std; #define ios_fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define lowbit(x) (x & (-x)) #define ll long long #define ull unsigned long long #define lld long double #define mp make_pair #define me(a, b) memset(a, (ll)(b...
C++
e9065e8bd9afb7d797527bc3a50f2150
12f2963c93c6def6ab073d6d31c5faf2
2,300
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; #define all(...) begin(__VA_ARGS__), end(__VA_ARGS__) #define fastIO() ios::sync_with_stdio(false),cin.tie(0),cout.tie(0) #define debug(x) std::cout << #x << " " << (x) << endl #define pb pus...
C++
e9065e8bd9afb7d797527bc3a50f2150
794fbad1d132f55fff0490c01d423d95
2,300
PASSED
#include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<map> #include<queue> #include<ctime> #include<algorithm> #include<iostream> #include<set> #include<sstream> #include<vector> #include<stack> #include<deque> #include<list> #include<cctype> //#include<unordered_map> #include<s...
C++
e9065e8bd9afb7d797527bc3a50f2150
41985c187476595b1bbcd123c30794df
2,300
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef pair<LL,LL> pii; typedef pair<LL,pii> ppi; typedef pair<pii,pii> ppp; #define FOR(i, n) for(int i = 1; i<=n; i++) #define F0R(i, n) for(int i = 0; i<n; i++) #define mp make_pair #define pb push_back #define f f...
C++
e9065e8bd9afb7d797527bc3a50f2150
d1a9f57405c92fb53e5710e043a5ef78
2,300
PASSED
#include <bits/stdc++.h> #define int long long using namespace std ; int ask ( int l , int r ) { cout << "? " << l << " " << r << endl ; cout.flush() ; int ans = 0 ; cin >> ans ; return ans ; } void Go () { int n = 0 ; cin >> n ; int i = 0 , j = 0 , k = 0 ; int inv = ask ( 1LL , n ) ; i...
C++
6be52845d61d8fbd297d742842acd28e
9c3aaf83ee2612b9aa22f491a3ea1ffc
2,000
PASSED
// Problem: D. Guess the Permutation // Contest: Codeforces - Codeforces Round #755 (Div. 2, based on Technocup 2022 Elimination Round 2) // URL: https://codeforces.com/contest/1589/problem/D // Memory Limit: 256 MB // Time Limit: 1000 ms //WorrywartsL # include <algorithm> # include <iostream> # include <cst...
C++
6be52845d61d8fbd297d742842acd28e
269d18cc0dd810c1eb0791af928a0aa7
2,000
PASSED
#include <iostream> using namespace std; #define db double #define int unsigned long long #define ll unsigned long long #define pii pair<int,int> #define rush() int T; cin >> T; while (T--) const int N = 1e5 + 5; const int M = (N << 2); const int P = 1e9 + 7; int n, l, r, i, j, k; ll sum, x; signed main() ...
C++
6be52845d61d8fbd297d742842acd28e
4380da1f79fd7806f93213b7aa820d35
2,000
PASSED
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <iomanip> #include <bitset> #include <assert.h> #define ull unsigned long long #defi...
C++
6be52845d61d8fbd297d742842acd28e
06a7a8092a5bcac1e132590cceffaa53
2,000
PASSED
#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<map> #include<cmath> #include<vector> #include<algorithm> #include<set> #define mem(x,y) memset(x,y,sizeof(x)) #define scan(x) scanf("%d",&x) #define scan2(x,y) scanf("%d%d",&x,&y) #define eps 1e-8 #define INF 0x3f3f3f3f #defin...
C++
6be52845d61d8fbd297d742842acd28e
629815d126d1f2417d21eb22ea2019d6
2,000
PASSED
#include<iostream> #include<cstring> #include<cstdio> #include<queue> #include<map> #include<cmath> #include<vector> #include<algorithm> #include<set> #define mem(x,y) memset(x,y,sizeof(x)) #define scan(x) scanf("%d",&x) #define scan2(x,y) scanf("%d%d",&x,&y) #define eps 1e-8 #define INF 0x3f3f3f3f #defin...
C++
6be52845d61d8fbd297d742842acd28e
7ffc1ff92061ea5f2bd1680b424bfc95
2,000
PASSED
//# include<unordered_map> //# include<unordered_set> # include<functional> # include<algorithm> # include<iostream> # include<iomanip> # include<cstring> # include<sstream> # include<string> # include<cstdio> # include<bitset> # include<cmath> # include<queue> # include<stack> # include<list> # include...
C++
6be52845d61d8fbd297d742842acd28e
8e2545a3ff6db29161828623d3153039
2,000
PASSED
//# include<unordered_map> //# include<unordered_set> # include<functional> # include<algorithm> # include<iostream> # include<iomanip> # include<cstring> # include<sstream> # include<string> # include<cstdio> # include<bitset> # include<cmath> # include<queue> # include<stack> # include<list> # include...
C++
6be52845d61d8fbd297d742842acd28e
8ea45d8064c5096e0909a6d6b4cf7539
2,000
PASSED
//# include<unordered_map> //# include<unordered_set> # include<functional> # include<algorithm> # include<iostream> # include<iomanip> # include<cstring> # include<sstream> # include<string> # include<cstdio> # include<bitset> # include<cmath> # include<queue> # include<stack> # include<list> # include...
C++
6be52845d61d8fbd297d742842acd28e
c40648476419d33cba18b8838e532316
2,000
PASSED
//# include<unordered_map> //# include<unordered_set> # include<functional> # include<algorithm> # include<iostream> # include<iomanip> # include<cstring> # include<sstream> # include<string> # include<cstdio> # include<bitset> # include<cmath> # include<queue> # include<stack> # include<list> # include...
C++
6be52845d61d8fbd297d742842acd28e
10f4adbc2b37dbf93a6c6c894de69fba
2,000
PASSED
#include<bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vii = vector<pii>; using vll = vector<pll>; #define fi first #define se second #define sz(c) ((int)(c).size()) #define all(c) (c).beg...
C++
833e5aaee828fa2db3882e46bea1a0df
58fa7c56e4ef170fe3e984cc61ad8158
2,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 __gnu_pbds; template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; //#define int long long int #define endl '\n' #def...
C++
833e5aaee828fa2db3882e46bea1a0df
37942afec123d6179d253f8a2e9e7b3b
2,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 __gnu_pbds; template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; //#define int long long int #define endl '\n' #def...
C++
833e5aaee828fa2db3882e46bea1a0df
a95c373fa228a51eaf87647955efb325
2,600
PASSED
/* どこでも侍のために日本です */ #include <algorithm> #include <iostream> #include <iomanip> #include <vector> #include <string> #include <bitset> #include <queue> #include <stack> #include <set> #define wall cout << "\n -------------------------- \n"; #define go(x) cout << x << ' '; continue; #define debug(x) cerr ...
C++
833e5aaee828fa2db3882e46bea1a0df
48d5701959be9391f61fb1f5f75c1c9d
2,600
PASSED
#include <bits/stdc++.h> typedef long double ld; typedef long long ll; using namespace std; #pragma GCC optimize("unroll-loops") #define int ll #define pb push_back #define vi vector<int> #define f first #define s second #define pii pair<int, int> void solve() { int n; cin >> n; string a[...
C++
833e5aaee828fa2db3882e46bea1a0df
ca4b64822866de49cd47169349978346
2,600
PASSED
#include <bits/stdc++.h> typedef long double ld; typedef long long ll; using namespace std; #pragma GCC optimize("unroll-loops") #define int ll #define pb push_back #define vi vector<int> #define f first #define s second #define pii pair<int, int> void solve() { int n; cin >> n; string a[...
C++
833e5aaee828fa2db3882e46bea1a0df
5cebe1ac8755c689ea74eb0953054c41
2,600
PASSED
#include<bits/stdc++.h> #define I inline #define max(a,b) ((a)>(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b)) #define abs(x) ((x)>0?(x):-(x)) #define re register #define RI re int #define ll long long #define db double #define lb long db #define N 10 #define M 106 #define mod 998244353 #define Mod (mod-1)...
C++
833e5aaee828fa2db3882e46bea1a0df
4864306849effb84adef0eaed2eb369b
2,600
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> typedef std::pair<long long, long long> PairLL; const int N = 200; int t, n, id[N][N][2], l[N], cnt, dp[1000000], p[1000000]; char s[N][N]; std::vector<int> ma[100000]; std::vector<int> vec; std::vector<char> vec_ans; int q[N][2000]; int ID...
C++
833e5aaee828fa2db3882e46bea1a0df
d6a2f72867468c6cd3645da45814921b
2,600
PASSED
/* どこでも侍のために日本です */ #include <algorithm> #include <iostream> #include <iomanip> #include <vector> #include <string> #include <bitset> #include <queue> #include <stack> #include <set> #define wall cout << "\n -------------------------- \n"; #define go(x) cout << x << ' '; continue; #define debug(x) cerr ...
C++
833e5aaee828fa2db3882e46bea1a0df
beb3c6e84a438dbcc59fa87a2e764328
2,600
PASSED
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> PII; int n; char s[150]; int pos[10][52][2]; int idx[10][150][52]; int nxt[10][150][52]; int ans[52][1 << 10]; PII res[52][1 << 10]{}; void solve(int c_, int mask_) { if (ans[c_][mask_]) return; for (int c = 0; c < 52; ++c) { int ma...
C++
833e5aaee828fa2db3882e46bea1a0df
c7b19d067d95638043bc4ed1a4f3ce10
2,600
PASSED
#include<bits/stdc++.h> using namespace std; //#define int long long #define ll long long #define pii pair<int,int> inline int read() { char ch = getchar(); int x = 0, f = 1; while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while ('0' <= ch && ch <= '9') { x = x * 10 + c...
C++
9336bfed41e9b277bdfa157467066078
a845039c1faf90a35785e24bc9b547a0
1,600
PASSED
#include <iostream> #include <vector> #include <iomanip> typedef long long ll; using namespace std; int main() { cout << fixed << std::setprecision(6); int n, t, a, i, j; int x, m; cin >> t; while (t--) { cin >> n; int xs[n]; int ms[n]; for ...
C++
9336bfed41e9b277bdfa157467066078
e049a68735df8405178c4166706850a4
1,600
PASSED
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; pair<double, double> calcPos(int lp, int lt, int rp, int rt){ pair<double, double> return_val; int templ = lp - lt; int tempr = rp + rt; double x0 = (0.0+templ + tempr) / 2; if(x0 >= rp) x0 = rp; if(x0 <= lp) x0 = lp;...
C++
9336bfed41e9b277bdfa157467066078
87c7bb1ed35930ac6ebd3a295a50a35e
1,600
PASSED
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; pair<double, double> calcPos(int lp, int lt, int rp, int rt){ pair<double, double> return_val; int templ = lp - lt; int tempr = rp + rt; double x0 = (0.0 + templ + tempr) / 2; if(x0 >= rp) x0 = rp; if(x0 <= lp) x0 = l...
C++
9336bfed41e9b277bdfa157467066078
5feef5ec144ce3bd4eb368c7f2b60ae5
1,600
PASSED
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; pair<double, double> calcPos(int lp, int lt, int rp, int rt){ pair<double, double> return_val; int templ = lp - lt; int tempr = rp + rt; double x0 = (0.0 + templ + tempr) / 2; if(x0 >= rp) x0 = rp; if(x0 <= lp) x0 = l...
C++
9336bfed41e9b277bdfa157467066078
3195078107331e7013ceefbf39036064
1,600
PASSED
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; pair<double, double> calcPos(int *lp, int *lt, int *rp, int *rt){ pair<double, double> return_val; int templ = *lp - *lt; int tempr = *rp + *rt; double x0 = (0.0 + templ + tempr) / 2; if(x0 >= *rp) x0 = *rp; if(x0 <= *l...
C++
9336bfed41e9b277bdfa157467066078
7420b71d3dc4ed4411b548eb2c42673b
1,600
PASSED
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; pair<double, double> calcPos(int lp, int lt, int rp, int rt){ pair<double, double> return_val; int templ = lp - lt; int tempr = rp + rt; double x0 = (0.0+templ + tempr) / 2; if(x0 >= rp) x0 = rp; if(x0 <= lp) x0 = lp;...
C++
9336bfed41e9b277bdfa157467066078
91a4ae163a02bcb7bddb7c8388316e49
1,600
PASSED
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<sstream> #include<map> using namespace std; bool myfunction (long double i,long double j) { return (i>j); } void readVector(vector<long double> &a, bool skipLine = false){ if(skipLine){ string empty_line; getline(std::cin, empty_l...
C++
9336bfed41e9b277bdfa157467066078
fc24c7237b2d23cd9a69b9cf80b35e7a
1,600
PASSED
#include<iostream> #include<algorithm> using namespace std; const int N = 100010; int a[N], b[N]; int k[2 * N]; int main(){ int t; cin>>t; while(t--){ int n; cin>>n; int res = 0; for(int i = 0; i < n; i++){ cin>>a[i]; } for(int i = 0; i < n; i++){ cin>>b[i]; } for(int i = 0; ...
C++
9336bfed41e9b277bdfa157467066078
35dd1be512ac3eca0eb589b6cc01953f
1,600
PASSED
// Problem: B. Meeting on the Line // Author : xiaoqiuuuu // URL: https://codeforces.com/contest/1730/problem/B #include<bits/stdc++.h> using namespace std; typedef long long LL ; //const int N = 1e5 +10; double ans; bool check(double x, vector<int> &a,vector<int> &b) { double l = 0 ; double r...
C++
9336bfed41e9b277bdfa157467066078
1b236fe39ef4d2b4692f53b876a98b92
1,600
PASSED
#include <iostream> using namespace std; #include <bits/stdc++.h>; int main() { int t; cin>>t; for (int i=0;i<t;i++) { int n,c; cin>>n>>c; int L[n]; for (int j=0;j<n;j++) { cin>>L[j]; } sort(...
C++
2805d460df1121c4410999a9f36e383a
71527951bb56c86b8728de19b4f5ad41
800
PASSED
#include<iostream> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #...
C++
2805d460df1121c4410999a9f36e383a
751d49409c530b47d4413fa6b4f499a7
800
PASSED
#include <algorithm> #include<bits/stdc++.h> #include <cctype> #include <chrono> #include <cinttypes> #include <cmath> #include <cstdarg> #include <cstdint> #include <cstdio> #include <cstring> #include <functional> #include <future> #include <ios> #include <iostream> #include <iterator> #include <map> #include <numeri...
C++
2805d460df1121c4410999a9f36e383a
b8035fa5000dbfdbb4704a9d2f5bb613
800
PASSED
#include<bits/stdc++.h> #define ll long long #define neu cout<<"\n"; #define tsts ll test; cin >> test; while(test--) using namespace std; void speedUp() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } ll gcd(ll a, ll b) { if (a == 0) return b; return gcd(b % a, a); } ll lcm(ll a, ll b){return (a * b) ...
C++
2805d460df1121c4410999a9f36e383a
53c1520f8a55152fd52628b10d238674
800
PASSED
#include <iostream> #include <vector> using namespace std; class ORBIT_PLANET { public: ORBIT_PLANET(int _orbit, int _planets) { orbit = _orbit; planets = _planets; } int orbit; int planets; }; int searchOrbits(vector<ORBIT_PLANET>& vect, int item) { int i = 0; for (; i < vect.size(); ++i) if (vect[i]....
C++
2805d460df1121c4410999a9f36e383a
76db9aa80652aa785e9b0c137b168ffb
800
PASSED
#include <bits/stdc++.h> using namespace std; int a[105]={0}; int d[105]={0}; int main() { int t,r; cin>>t; while(t--) { r=0; int n,c,b; cin>>n>>c; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int j=1;j<=100;j++) { d[j]=0; } int f=a[1]; for(int i=2;i<=n;i++) { if(f<a[i]) f=a[i]; } ...
C++
2805d460df1121c4410999a9f36e383a
8133631ca54df0719ae9da09d1bfaf56
800
PASSED
#include <iostream> #include <string.h> using namespace std; int a[1001]; int main(){ int t,n,c; scanf("%d",&t); while(t--){ int tmp=0,num=0,ans=0; memset(a,0,sizeof(a)); scanf("%d%d",&n,&c); for(int i=0;i<n;i++){ scanf("%ld",&tmp); a[tmp]++; } for(int i=1;i<=100;i++){ if(a[i]>c){ ans+=c; ...
C++
2805d460df1121c4410999a9f36e383a
3982fb9e45e8a85724ffb27ddd8d90e6
800
PASSED
#include <iostream> using namespace std; int main() { int tt; cin >> tt; while (tt --){ int n, c; cin >> n >> c; int a[110]; for (int i = 0; i < 110; i ++){ a[i] = 0; } for (int i = 0; i < n; i ++){ int x; cin >> x; ...
C++
2805d460df1121c4410999a9f36e383a
2fa021fb00b2412fc085024fe7d7c2d0
800
PASSED
#include<bits/stdc++.h> using namespace std; map<int ,int >a; int main() { int t; scanf("%d",&t); while(t--) { int n,c; int sum=0; scanf("%d%d",&n,&c); int tt; for(int i=0;i<n;i++) { scanf("%d",&tt); a[tt]++; } for(a...
C++
2805d460df1121c4410999a9f36e383a
209211249aae42cb8e58f8937f6c8c23
800
PASSED
#include <bits/stdc++.h> #define test(t) int t;cin>>t;while(t--) #define int long long #define double long double #define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ok(x) cout<<(x?"YES\n":"NO\n") #define endl '\n' #define Endl '\n' #define al(n) n.begin(), n.end() #define all(n) n.rbegin(), n....
C++
2805d460df1121c4410999a9f36e383a
74c08ba9b61ee54bb8b5f446b50a2692
800
PASSED
#include <bits/stdc++.h> #define r(i,n) for(i=0;i<n;i++) #define N return puts("NO"); #define A r(i,26)r(j,26)if(c[i][j]+(i!=j)*c[j][i]&1) int t,n,i,j,_;s(){std::string s,t;std::cin>>n>>s>>t;int c[26][26]{};r(i,n)c[s[i]-97][t[n-1-i]-97]++;if(n&1){n=0;A{if(i!=j||n)N n=1;}}else A N return puts("YES");}main(){std::cin>>t;...
C++
2d011ba7eaa16642d77dade98966b54a
3050fce35352f2a6e39bb265a4f69d6d
2,200
PASSED
#include <bits/stdc++.h> #define r(i,n) for(i=0;i<n;i++) #define N return puts("NO"); #define A r(i,26)r(j,26)if(c[i][j]+(i!=j)*c[j][i]&1) int t,n,i,j,o,_;s(){std::string s,t;std::cin>>n>>s>>t;int c[26][26]{};r(i,n)c[s[i]-97][t[n-1-i]-97]++;if(n&1){o=0;A{if(i!=j||o)N o=1;}}else A N return puts("YES");}main(){std::cin>>...
C++
2d011ba7eaa16642d77dade98966b54a
5205f8150049af130dd4ab49765b9c77
2,200
PASSED
#include <bits/stdc++.h> #define r(i,n) for(i=0;i<n;i++) #define N return puts("NO"); int t,n,i,j,o,_;s(){std::string s,t;std::cin>>n>>s>>t;int c[26][26]{};r(i,n)c[s[i]-97][t[n-1-i]-97]++;if(n&1){o=0;r(i,26)r(j,26)if(c[i][j]+(i!=j)*c[j][i]&1){if(i!=j||o)N o=1;}}else r(i,26)r(j,26)if(c[i][j]+(i!=j)*c[j][i]&1)N return pu...
C++
2d011ba7eaa16642d77dade98966b54a
bf81ae512b44899a4668af2db932941b
2,200
PASSED
#include <bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) #define N return puts("NO"); s(){int n;std::string s,t;std::cin>>n>>s>>t;int c[26][26]{};r(i,n)c[s[i]-97][t[n-1-i]-97]++;if(n&1){ int o=0;r(i,26)r(j,26)if(c[i][j]+(i!=j)*c[j][i]&1){if(i!=j||o)N o=1;}}else r(i,26)r(j,26)if(c[i][j]+(i!=j)*c[j][i]&1)N return put...
C++
2d011ba7eaa16642d77dade98966b54a
2eb449222b931c6f2acfea04e3f2affc
2,200
PASSED