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<iostream> #define ll long long #define db(x) cout<<#x<<"="<<x<<endl; using namespace std; int a[1005][1005]; int main(){ ll n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { cin>>a[i][j]; } } while(k--) { ll t; int i=1,j; cin>>t; j=t; while(i<=n) { if(a[i][j]==...
C++
eb480feb52669fba538c18544e7cad16
aec1a7228a3b41580824163130bac1c8
1,500
PASSED
#include<iostream> #include<cmath> #include<cstring> #include<cstdio> #include<string.h> #include<algorithm> #include<map> #include<string> #include<stack> using namespace std; int main() { int n,m,k; cin>>n>>m>>k; int a[1005][1005]={0}; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { cin>>a[i]...
C++
eb480feb52669fba538c18544e7cad16
4e25889d8e709751d262fc4215099ed9
1,500
PASSED
#include <iostream> #include <algorithm> #include <math.h> #include <string.h> #include <stack> #include <queue> using namespace std; int n,m,k,c,a[1009][1009]; int main() { scanf("%d%d%d",&n,&m,&k); for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { scanf("%d",&a[i][j]); ...
C++
eb480feb52669fba538c18544e7cad16
058b1e84380380f1ccc0f383c36c667f
1,500
PASSED
#include <iostream> #include <algorithm> #include <math.h> #include <string.h> #include <stack> #include <queue> using namespace std; int n,m,k,c,a[1009][1009]; int main() { scanf("%d%d%d",&n,&m,&k); for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { scanf("%d",&a[i][j]); ...
C++
eb480feb52669fba538c18544e7cad16
aea0f2af33665741a3c4c60e69c24046
1,500
PASSED
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- /* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx,avx2,fma") */ // -------------------</optimizations>-------------------...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
773c496a29b775a737d7f05669df4ba7
2,300
PASSED
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- /* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx,avx2,fma") */ // -------------------</optimizations>-------------------...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
735abebfb8ba3cd2e8a98affac678e60
2,300
PASSED
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- /* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx,avx2,fma") */ // -------------------</optimizations>-------------------...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
190d12cc293dfc596dbcbba15025ee60
2,300
PASSED
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- /* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx,avx2,fma") */ // -------------------</optimizations>-------------------...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
2e680eccde70b4d82490144146096913
2,300
PASSED
// --------------------------------------------------<TEMPLATE>-------------------------------------------------- // --------------------<optimizations>-------------------- /* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx,avx2,fma") */ // -------------------</optimizations>-------------------...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
fcb470b36df8dc61e5c83f526ed124f6
2,300
PASSED
/** * Copyright (C) 2021 All rights reserved. * * filename: i.cpp * author: doublehh * e-mail: sserdoubleh@gmail.com * create time: 2021-10-03 01:21:51 * last modified: 2021-10-03 01:21:51 */ #include <bits/stdc++.h> using namespace std; const int N = 18; template<typename T> class ...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
4322d4593f8eefca8c16d2628313f5a3
2,300
PASSED
/** * Copyright (C) 2021 All rights reserved. * * filename: i2.cpp * author: doublehh * e-mail: sserdoubleh@gmail.com * create time: 2021-10-03 02:50:13 * last modified: 2021-10-03 02:50:13 */ #include <bits/stdc++.h> using namespace std; template<typename T> class BinaryIndexedTree { ...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
e46595a2c2d959f6d1043133b784fbc2
2,300
PASSED
/** * Copyright (C) 2021 All rights reserved. * * filename: i2.cpp * author: doublehh * e-mail: sserdoubleh@gmail.com * create time: 2021-10-03 02:50:13 * last modified: 2021-10-03 02:50:13 */ #include <bits/stdc++.h> using namespace std; template<typename T> class BinaryIndexedTree { ...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
202ab957649a33b442b3e8bce9952f61
2,300
PASSED
/** * Copyright (C) 2021 All rights reserved. * * filename: i.cpp * author: doublehh * e-mail: sserdoubleh@gmail.com * create time: 2021-10-03 01:21:51 * last modified: 2021-10-03 01:21:51 */ #include <bits/stdc++.h> using namespace std; const int N = 18; struct zkw_segmentree { i...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
1ce84da05c724df7aee214d2f9f20aee
2,300
PASSED
/** * Copyright (C) 2021 All rights reserved. * * filename: i2.cpp * author: doublehh * e-mail: sserdoubleh@gmail.com * create time: 2021-10-03 02:50:13 * last modified: 2021-10-03 02:50:13 */ #include <bits/stdc++.h> using namespace std; template<typename T> class BinaryIndexedTree { ...
C++
99e3ab8db0a27cdb6882486dcd46ef0b
2dedfa611dc433de4cc1cdcb6fb56956
2,300
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using str = string; #define mset multiset #define all(x) (x).begin(), (x).end() #define sz(x) int((x).size()) #define g0 get<0> #define g1 get<1> #define g2 get<2> #define g3 get<3> ...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
759c653669cc8d162022d366fafacd40
2,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using str = string; #define mset multiset #define all(x) (x).begin(), (x).end() #define sz(x) int((x).size()) #define g0 get<0> #define g1 get<1> #define g2 get<2> #define g3 get<3> ...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
9ad682f692327d0fdaf2fd632c7c7feb
2,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using str = string; #define multiset mset #define all(x) (x).begin(), (x).end() #define sz(x) int((x).size()) #define g0 get<0> #define g1 get<1> #define g2 get<2> #define g3 get<3> ...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
a011b7394e25f1d41ce04673621f1c0d
2,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define all(x) (x).begin(), (x).end() #define sz(x) int((x).size()) #define g0 get<0> #define g1 get<1> #define g2 get<2> #define g3 get<3> #define mill (int)(1e6) #define bill (...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
f4d177c441cef5e669edecf1ace374cb
2,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define all(x) (x).begin(), (x).end() #define sz(x) int((x).size()) #define g0 get<0> #define g1 get<1> #define g2 get<2> #define g3 get<3> #define mill (int)(1e6) #define bill (...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
f9c24986c1bce301c5ddb89efeb57177
2,100
PASSED
#include <iostream> #include<algorithm> using namespace std; int q[10000000]; int p[10000000]; struct node { int num; int c; }a[10000000]; bool cmp(node x1, node x2) { if (x1.num < x2.num) { return 1; } else if (x1.num == x2.num) { return x1.c < x2.c; ...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
10fb37a773dfbe7f2dc4836e1dcbeae5
2,100
PASSED
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #define FOR(i,a,b) for(int i=a;i<=b;++i) #define PII pair<int,int> #define ll long long #define pb push_back #define sz(x) (int)(x.size()) #define rd (rand()<<16^rand()) #define db double #define mk make_pair #define iter set<int>::iterator #define gc (_p...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
39b704e26f0ceb3b3faf8c2445dcafcf
2,100
PASSED
//#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #define FOR(i,a,b) for(int i=a;i<=b;++i) #define PII pair<int,int> #define ll long long #define pb push_back #define sz(x) (int)(x.size()) #define rd (rand()<<16^rand()) #define db double #define gc getchar() #define mk make_pair #define iter set<int>::...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
4215ce8deec9a877da4d51f5c507094b
2,100
PASSED
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #define FOR(i,a,b) for(int i=a;i<=b;++i) #define PII pair<int,int> #define ll long long #define pb push_back #define sz(x) (int)(x.size()) #define rd (rand()<<16^rand()) #define db double #define gc getchar() #define mk make_pair #define iter set<int>::it...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
7f49bbfc3d3d7cf6a50c882253773cc4
2,100
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ int n,s,a,b,c,d,e,i,j,k; set<int> ans; vector<pair<int,int>> all; scanf("%d",&n); for(i=1;i<=n;++i){ scanf("%d",&a); if(i>=a){ all.push_back(make_pair(i-a,a)); //cout<<"inserted: "<<i-x<<','...
C++
694bc30b982ec6ec78fec2ba41ed1ef3
d8c76ddf1227ae50e15a6f9cf31b63c9
2,100
PASSED
// This Code was made by Chinese_zjc_. #include <bits/stdc++.h> // #define debug const unsigned MOD = 1000000007; int n, k, fa[1000005], max[1000005], sec[1000005], dep[1000005], heavy[1000005]; bool heavyv[1000005]; std::vector<int> to[1000005][2]; struct mint { unsigned v; mint(unsigned v_ = 0) : v(...
C++
54c1c5a1b862845193d484487094cee2
b5a555117408b75299babba463b4f532
2,600
PASSED
#include<bits/stdc++.h> using namespace std; #define rg register #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define vc vector #define epb emplace_back #define fi first #define se second const int N=2e5+5,mod=1e9+7; vc<pii> g[N]; vc<pll> h; int rt,siz[N],a[N],n,k,vis[N]; ll ans=...
C++
54c1c5a1b862845193d484487094cee2
4a886d1bf34303cee4d011c02331e342
2,600
PASSED
#include<bits/stdc++.h> #pragma GCC optimize(2) using namespace std; #define rg register #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define vc vector #define epb emplace_back #define fi first #define se second const int N=2e5+5,mod=1e9+7; vc<pii> g[N]; vc<pll> h; int rt,siz[N],...
C++
54c1c5a1b862845193d484487094cee2
6313e42656462e4c9de429fc5772a614
2,600
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; const int N=2e5+5; const int p=1e9+7; ll read(){static ll x;scanf("%lld",&x);return x;} void write(ll x){printf("%lld",x);} void print(ll x,char c='\n'){write(x),putchar(c);} inline void add(int &x,int y){x+=y;if (x>=p) x-=p;} struct edge{int to,val;};...
C++
54c1c5a1b862845193d484487094cee2
bd134fa3f99f794cefaf9b101ea98a14
2,600
PASSED
#include <stdio.h> #include <vector> #define MIN(a,b) (((a)<(b))?(a):(b)) using namespace std; using ll=long long; const int C=300001, M=1000000007; inline ll pow (ll a, ll b, ll M){ ll c=1; while (b>0){ if (b%2==1) c=(c*a)%M; b/=2; a=(a*a)%M; } return c; } int s[C], is=0, ip=1, pre[C], apr...
C++
54c1c5a1b862845193d484487094cee2
518d76073c7adcc82a3b7c4ddf700c37
2,600
PASSED
#include <bits/stdc++.h> #define rep(i, a, b) for(int i = (a); i <= int(b); i ++) #define per(i, a, b) for(int i = (a); i >= int(b); i --) #define fi first #define se second #define all(s) s.begin(),s.end() #define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].next].to) #define sz(s) (int)(s.s...
C++
54c1c5a1b862845193d484487094cee2
197ac7f9ae5975bc30bedb9d4150033d
2,600
PASSED
#include <bits/stdc++.h> #define rep(i, a, b) for(int i = (a); i <= int(b); i ++) #define per(i, a, b) for(int i = (a); i >= int(b); i --) #define fi first #define se second #define all(s) s.begin(),s.end() #define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].next].to) #define sz(s) (int)(s.s...
C++
54c1c5a1b862845193d484487094cee2
204ebb5f0e3dffffd2dddea4cbb73577
2,600
PASSED
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <assert.h> #include <stack> #include <vector> #include <cmath> #include <queue> #include <map> #include <unordered_set> #include <set> #include <time.h> #include <unordered_map> using namespace std; const int mod =...
C++
54c1c5a1b862845193d484487094cee2
0df956411a4fea982c31b21af6c7aa30
2,600
PASSED
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include <iostream> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double db; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_...
C++
54c1c5a1b862845193d484487094cee2
27059beacf423da98981f4d77822b9c3
2,600
PASSED
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 const int N = 2e5 + 5; int n, k, a[N], u, v, w, edgenum, Head[N], Next[N<<1], vet[N<<1], val[N<<1], siz[N], mx[N], tot, rt, vis[N], dep[2], nowd, cnt[2][N], nowc[N], sum[2][N], nows[N], ans; char B[1<<23], * S = B; int read() { int s = 0; wh...
C++
54c1c5a1b862845193d484487094cee2
776f804a0db8c6a0b64c50e2065f4ab7
2,600
PASSED
/// #include <bits/stdc++.h> using namespace std; #define ll long long //#define double long double #define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); const double E = 2.71828182845904523536; const double pi = acos(-1); const double EPS = 1e-10; const int mod = 1e9 + 7; const int N = 2e5 + 10;...
C++
eace1228b78f4f2e9977f0efe581ac7b
5b5f48cf1b53ec5e94d668ec84ae028c
2,300
PASSED
/// #include <bits/stdc++.h> using namespace std; #define ll long long //#define double long double #define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); const double E = 2.71828182845904523536; const double pi = acos(-1); const double EPS = 1e-9; const int mod = 1e9 + 7; const int N = 2e5 + 10; ...
C++
eace1228b78f4f2e9977f0efe581ac7b
dfb104d65e5ceb74da54edf44d7de6f1
2,300
PASSED
/// #include <bits/stdc++.h> using namespace std; #define ll long long //#define double long double #define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); const double E = 2.71828182845904523536; const double pi = acos(-1); const double EPS = 1e-9; const int mod = 1e9 + 7; const int N = 2e5 + 10; ...
C++
eace1228b78f4f2e9977f0efe581ac7b
6969b322dbc139e718d27088da116200
2,300
PASSED
/// #include <bits/stdc++.h> using namespace std; #define ll long long #define double long double #define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); const double E = 2.71828182845904523536; const double pi = acos(-1); const double EPS = 1e-10; const int mod = 1e9 + 7; const int N = 2e5 + 10; ...
C++
eace1228b78f4f2e9977f0efe581ac7b
e75aba2c5fe733d78720e97a99185a9b
2,300
PASSED
/// #include <bits/stdc++.h> using namespace std; #define ll long long #define double long double #define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); const double E = 2.71828182845904523536; const double pi = acos(-1); const double EPS = 1e-10; const int mod = 1e9 + 7; const int N = 2e5 + 10; ...
C++
eace1228b78f4f2e9977f0efe581ac7b
14d1aaa122da76f36ae776aa4452dd4b
2,300
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; const double eps = 1e-10; const double pi = 3.14159265358979323846; template<typename T> struct point { T x, y; bool operator==(const point& a) const { return (abs(x - a.x) <= eps && abs(y - a.y) <= eps); } bool operator<(const point& ...
C++
eace1228b78f4f2e9977f0efe581ac7b
7e23795387943da806e2d0ecdcbaa08c
2,300
PASSED
#include<bits/stdc++.h> #define pi acos(-1) using namespace std; const int N=3e5+8; const double eps=1e-6; inline int read() { int s=1,a=0;char c=getchar(); while(!isdigit(c)) s=(c=='-')?(-s):s,c=getchar(); while(isdigit(c)) a=(a<<3)+(a<<1)+c-'0',c=getchar(); return s*a; } struct vec { d...
C++
eace1228b78f4f2e9977f0efe581ac7b
fa2bcac026132272e6edc66e75820b09
2,300
PASSED
/*---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---*/ #include "bits/stdc++.h" using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define dbg(x...) #endif #define rep(i, a, b) for(int i = a; i < (b); ++i) #define rrep(a, b, c) for(int a = (b)...
C++
eace1228b78f4f2e9977f0efe581ac7b
50f750cfa125c233e2c61bce45f1f56e
2,300
PASSED
#include <bits/stdc++.h> // #define int long long #define ff first #define ss second #define ll long long #define ld double #define pb push_back #define eb emplace_back #define vi vector<int> #define sws cin.tie(0)->sync_with_stdio(false); #define endl '\n' using namespace std; const int N = 2e5+10; const ll MOD = ...
C++
eace1228b78f4f2e9977f0efe581ac7b
02546dbcee30118544e0f18a29c51c93
2,300
PASSED
#include <bits/stdc++.h> // #define int long long #define ff first #define ss second #define ll long long #define ld long double #define pb push_back #define eb emplace_back #define vi vector<int> #define sws cin.tie(0)->sync_with_stdio(false); #define endl '\n' using namespace std; const int N = 2e5+10; const ll M...
C++
eace1228b78f4f2e9977f0efe581ac7b
c11fdc5706e894c8facc175a767ff1ef
2,300
PASSED
#include <iostream> #include <vector> #include <chrono> #include <cstdint> #include <algorithm> #include <set> #include <cmath> #include <queue> #include <deque> #include <cassert> #include <map> #include <iomanip> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; const int MAX = 1e5 ...
C++
a63f7416aa94f8a3f58d2a8fea636cac
d3d9d9bbcd4cfc6053354f711f963c74
2,200
PASSED
#include<bits/stdc++.h> using namespace std; using lol=long long int; #define endl "\n" const lol mod1=1e9+7,mod2=998244353; const lol inf=1e9+8; const double eps=1e-12; const int N=1e5+5; #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_stati...
C++
a63f7416aa94f8a3f58d2a8fea636cac
e0740eae67ed9873e8b7b10fef2ecac0
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const int N=1e5+5,mod=1e9+7; int n,a[N...
C++
a63f7416aa94f8a3f58d2a8fea636cac
96059143cf3fe7a9a004c416b34a0a8c
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const int N=1e5+5,MOD=1e9+7; int n,a[N...
C++
a63f7416aa94f8a3f58d2a8fea636cac
a8c5b7d02dfd40bfe749d79ceca6e6a7
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const int N=1e5+5,MOD=1e9+7; int n,a[N...
C++
a63f7416aa94f8a3f58d2a8fea636cac
188e178f322624426cfe4119b692601d
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const long long MOD=1e9+7; void add(lo...
C++
a63f7416aa94f8a3f58d2a8fea636cac
32f4b254a44996153c081a02016478a1
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const long long MOD=1e9+7; void add(lo...
C++
a63f7416aa94f8a3f58d2a8fea636cac
6d785df52bed18092a56e48223c89ff7
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const long long MOD=1e9+7; int add(int...
C++
a63f7416aa94f8a3f58d2a8fea636cac
ac0b3f37b03f8595fed5f187346ff969
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const long long MOD=1e9+7; int add(int...
C++
a63f7416aa94f8a3f58d2a8fea636cac
a83c61105c44724572a0298667b27875
2,200
PASSED
#include<cstdio> #include<algorithm> #include<cstring> #include<string> using namespace std; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return x*f; } const long long MOD=1e9+7; int add(int...
C++
a63f7416aa94f8a3f58d2a8fea636cac
6d3ed314706e8d9242767c6fc81cb4d8
2,200
PASSED
#include <bits/stdc++.h> #define int long long #define N 2010 #define INF 1000000000 using namespace std; int n,m,ans; int dis[N][N],c[N][N]; char s[N][N]; inline void solve(int row,int tl,int tr,int l,int r) { if(l > r) return ; int mid = (l + r) >> 1; dis[row][mid] = INF; int t = tl; for(int i ...
C++
513e36038ca3f9b4a29f9c4217d3c24b
e70fd0d22156dcfc621f38435fbf24b9
2,400
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long const int N=2e3+11; const int inf=0x7fffffff; struct sta_{ int a,sum,l; friend bool operator<(sta_ a,sta_ b){return a.a<b.a;} }sta[2*N],st[2*N],now; bool jud[N][N]; int n,m; int top,num; vector<int> vct[N]; inline int pd(int x){return x*x;} inline boo...
C++
513e36038ca3f9b4a29f9c4217d3c24b
36a6c9c45d15433fd96b4da6fb3f1948
2,400
PASSED
#include <cstdio> #include <utility> #include <algorithm> using namespace std; const int inf = 1 << 29; char s[2010][2010]; int h[2010][2010]; pair<int, int> p[2010]; int l[2][2010]; int main() { int n, m; scanf("%d%d", &n, &m); ++n; ++m; for (int i = 0; i < n; i++) { scanf("%s", s[i]); } for (int j = 0; j < m;...
C++
513e36038ca3f9b4a29f9c4217d3c24b
a1279e50c6cccfa3c6fba5bad9d9f294
2,400
PASSED
#include<iostream> #include<cstdio> #define inf 1145141919 using namespace std; int n,m; long long ans; int a[2005][2005]; int dis[2005][2005]; int p[2005],nx[2005],ny[2005]; int stk[2005],top; void updt(int &x,int y){ if(x>y) x=y; return; } long double slope(int i,int j){ return 1.0*(ny[j]-ny[i])/(nx[...
C++
513e36038ca3f9b4a29f9c4217d3c24b
1569a02fe024aec6ae17331002b28525
2,400
PASSED
#include<cstdio> #include<algorithm> #include<ctype.h> #include<cstring> #define int long long using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();} return x*f; } int g[2005][2005...
C++
513e36038ca3f9b4a29f9c4217d3c24b
47854c9026be72d4d986337fefa56598
2,400
PASSED
#include<cstdio> #include<algorithm> #include<ctype.h> #include<cstring> #define int long long using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();} return x*f; } int g[2005][2005...
C++
513e36038ca3f9b4a29f9c4217d3c24b
051f93978e3ded93d8b61b297e313bb3
2,400
PASSED
#include<bits/stdc++.h> #define INF (ll)(1e18) #define pb push_back #define mp make_pair #define ft first #define sd second using namespace std; using ll = long long; using ul = unsigned long; void f_io () { ios_base :: sync_with_stdio (false); cin.tie (nullptr);; cout.tie (nullptr); } const ll MOD = 1e9 + 7; ll gc...
C++
513e36038ca3f9b4a29f9c4217d3c24b
34a4dc3f8495b36b457aca3ab2761411
2,400
PASSED
#include<bits/stdc++.h> typedef long long LL; const int N=4e3+3; int n,m,q[N],lst[N];char a[N][N];LL f[N][N]; #define Y(o) ((LL)(o)*(o)+(LL)(lst[o]-i)*(lst[o]-i)) #define K(o) ((LL)(o)*2) #define X(o) (LL)(o) void solve(){ memset(lst,0,sizeof lst);//即题解中的 last for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++)if(a[i][j]=...
C++
513e36038ca3f9b4a29f9c4217d3c24b
4e21c59b300f83ed0d2300a8bafb663a
2,400
PASSED
#include<bits/stdc++.h> #define int long long #define ull unsigned long long #define f() cout<<"RP++"<<endl using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();} return x*f; } const ...
C++
513e36038ca3f9b4a29f9c4217d3c24b
b613af5a0b2b16c033f2fd2ae17bfa74
2,400
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long #define fxt(i,x,y) for(int i=(x);i<=(y);i++) #define pyt(i,x,y) for(int i=(x);i>=(y);i--) const int N=2005; int n,m,jz[N][N],X; char s[N]; int las[N],q[N],head,tail; int dp[N][N];ll ans; int y(int o){return -2*las[o]*X+las[o]*las[o]+o*o;} int x(int o){re...
C++
513e36038ca3f9b4a29f9c4217d3c24b
708562459caba5571d032db5c98156d1
2,400
PASSED
#line 1 "c.cpp" /* Author: dendi239 Time: 2021-10-02 18:06:01 */ #include <bits/stdc++.h> #define requires(...) typename std::enable_if<__VA_ARGS__::value, int>::type = 0 using namespace std; template<class U, class V> istream &operator>>(istream &is, pair<U, V> &p) { return is >> p.first >> p.se...
C++
10c113e328b4704e643e3f62f1b8fcd3
31e474800a251999f0a59efb6bc4ccf7
3,000
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; int n, m, k, a[200200], s[200200], id[200200]; ll c[200200], pl[400400], ans; int main(){ cin.tie(0)->sync_with_stdio(0); cin >> n >> m >> k; for(int i=1;i<=n;i++) cin >> a[i]; for(int i=1;i<=n;i++...
C++
10c113e328b4704e643e3f62f1b8fcd3
92a0c30ee6d76e26fe82ac9495c72d2a
3,000
PASSED
// ################################################################################################# // # You told me # // # At your absolute best, you still won't be good enough for the wrong person # // # ...
C++
10c113e328b4704e643e3f62f1b8fcd3
c22fe9efb15af12e520d22745179ff6f
3,000
PASSED
#include <bits/stdc++.h> typedef unsigned long long ull; typedef long long ll; #define inf 0x3f3f3f3f #define rep(i, l, r) for (int i = l; i <= r; i++) #define nep(i, r, l) for (int i = r; i >= l; i--) void sc(int &x) { scanf("%d", &x); } void sc(int &x, int &y) { scanf("%d%d", &x, &y); } void sc(int &x, int &y...
C++
10c113e328b4704e643e3f62f1b8fcd3
e61e287087e3e6211ff52fffbf87cc0f
3,000
PASSED
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define maxn 200010 #define ll long long namespace fft { typedef long double dbl; struct num { dbl x, y; num() { x = y = 0; } num(dbl x, dbl y) : x(x), y(y) { } }; inline num operator+(num a, num b) { return num(a...
C++
10c113e328b4704e643e3f62f1b8fcd3
cf9064ec441ea37d437527b39de9f13f
3,000
PASSED
#include <iostream> #include <vector> #include <cassert> #include <list> #include <algorithm> #include <bitset> #include <cmath> #include <climits> #include <complex> #include <chrono> using namespace std; #define vec vector #define ll long long #define pi pair<int, int> #define pll pair<ll, ll> const ll mod = 100000...
C++
10c113e328b4704e643e3f62f1b8fcd3
5a31f0a6365e4167f55ae4b524629619
3,000
PASSED
#include <iostream> #include <iomanip> #include <cstdio> #include <vector> #include <bitset> #include <string> #include <cstring> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <utility> #include <algorithm> #include <random> #include <cmath> #include <cassert>...
C++
10c113e328b4704e643e3f62f1b8fcd3
dec8fbd9da63dd6c76fff4839c51bc4a
3,000
PASSED
#include <iostream> #include <iomanip> #include <cstdio> #include <vector> #include <bitset> #include <string> #include <cstring> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <utility> #include <algorithm> #include <random> #include <cmath> #include <cassert>...
C++
10c113e328b4704e643e3f62f1b8fcd3
089ba93fad06e2f7e1c89400983806a4
3,000
PASSED
#include <iostream> #include <iomanip> #include <cstdio> #include <vector> #include <bitset> #include <string> #include <cstring> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <utility> #include <algorithm> #include <random> #include <cmath> #include <cassert>...
C++
10c113e328b4704e643e3f62f1b8fcd3
b9e9211a0f5f0e8926136cef0ae0e867
3,000
PASSED
#include <bits/stdc++.h> using namespace std; int mod = 1e9+7; int pow_mod(int a, int k) { if(k == 0) { return 1; } int sub = pow_mod(a, k/2); if(k%2 == 0) { return ((long long)sub*sub)%mod; } else { return (((long long)sub*sub)%mod*a)%mod; } } int inv_mod(int a) { return pow_mod(a, ...
C++
10c113e328b4704e643e3f62f1b8fcd3
bdb1ca9e87180a93831d1dd75f58ce7c
3,000
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define kyou using #define mo namespace #define kawaii std #define chisai chrono #define dekai __gnu_pbds; kyou mo kawaii; kyou mo chisai; kyou mo dekai; typedef tree<int, null_type, less<int>, rb_tre...
C++
0d880f4b73d77e95fb2aa9ab56b68993
39d0db93a1b06d4a91b4c093a69208d2
2,900
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define kyou using #define mo namespace #define kawaii std #define chisai chrono #define dekai __gnu_pbds; kyou mo kawaii; kyou mo chisai; kyou mo dekai; typedef tree<int, null_type, less<int>, rb_tre...
C++
0d880f4b73d77e95fb2aa9ab56b68993
5c07a3d5205d470ab35cf4449e3a3c77
2,900
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define kyou using #define mo namespace #define kawaii std #define chisai chrono #define dekai __gnu_pbds; kyou mo kawaii; kyou mo chisai; kyou mo dekai; typedef tree<int, null_type, less<int>, rb_tre...
C++
0d880f4b73d77e95fb2aa9ab56b68993
e0541b8055fe795e694954b022ac2112
2,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int c=300005; ll n, sum, t[c], fakt[c], inv[c], dp[c], gy[c], mod=1e9+7, f, udb; map<int, int> m; ll po(ll a, ll b) { ll ans=1; while (b) { if (b%2) ans=ans*a%mod; a=a*a%mod, b/=2; } return ans; } l...
C++
0d880f4b73d77e95fb2aa9ab56b68993
d21c2f2397f7fc62d3941f28b5bb753f
2,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int c=300005; ll n, sum, t[c], fakt[c], inv[c], t2[c], dp[c], gy[c], mod=1e9+7, f, udb; map<int, int> m; ll po(ll a, ll b) { ll ans=1; while (b) { if (b%2) ans=ans*a%mod; a=a*a%mod, b/=2; } return ans...
C++
0d880f4b73d77e95fb2aa9ab56b68993
55100f62f363c262d568fbc2f54b156c
2,900
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const int mod = 1e9 + 7; int n, m, k, f[N], p[N], s[N], fac[N], ifac[N]; unordered_map<int, int> cnt; inline int qpow(int a, int b) { int c = 1; for (; b; b >>= 1, a = 1LL * a * a % mod) if (b & 1) c = 1ll * c * a % mod; return...
C++
0d880f4b73d77e95fb2aa9ab56b68993
362d7b891b8affae9526268e4d36db1e
2,900
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const int mod = 1e9 + 7; int n, m, k, f[N], p[N], s[N], fac[N], ifac[N]; unordered_map<int, int> cnt; int qpow(int a, int b) { int c = 1; for (; b; b >>= 1, a = 1LL * a * a % mod) if (b & 1) c = 1ll * c * a % mod; return c; }...
C++
0d880f4b73d77e95fb2aa9ab56b68993
8c71087e996abe49de4e5f53f1fb7669
2,900
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; const int mod = 1e9 + 7; int n, m, k, f[N], p[N], s[N], fac[N], ifac[N]; unordered_map<int, int> cnt; int qpow(int a, int b) { int c = 1; for (; b; b >>= 1, a = 1LL * a * a % mod) if (b & 1) c = 1ll * c * a % mod; return c; }...
C++
0d880f4b73d77e95fb2aa9ab56b68993
8724d9f4721403555166d8431759b08a
2,900
PASSED
// author: xay5421 // created: Tue Oct 12 18:36:39 2021 #ifdef xay5421 #define D(...) fprintf(stderr,__VA_ARGS__) #else #define D(...) ((void)0) //#define NDEBUG #endif #include<bits/stdc++.h> #define SZ(x) ((int)(x).size()) #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define per(i,a,b) for(int i=(a);i>=(b);--i) using...
C++
0d880f4b73d77e95fb2aa9ab56b68993
51defa55bbe72ec3472c262f8f930060
2,900
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 100005,P = 1000000007; using ll = long long; ll qpow(ll a,ll b) { ll ret = 1; while (b) { if (b & 1) ret = ret * a % P; a = a * a % P;b >>= 1; } return ret; } int n,kk,a[N];ll f[N],fac[N],ifac[N],pw[N]; inline ll C(int n,int m) {return ...
C++
0d880f4b73d77e95fb2aa9ab56b68993
ca55f003b4895b399c4623c05a1ed6f0
2,900
PASSED
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define ckmin(a, b) a = min(a, b) #define ckmax(a, b) a = max(a, b) #define ld long double #define pii pair<int, int> #define fi first #define se second #define sz(a) (int)a.size() const int N = 5e7; ...
C++
2508a347f02aa0f49e0d154c54879b13
358f5aaaa8b20eb9bd845b87ba2a27c8
2,300
PASSED
// #pragma GCC target("avx2") // #pragma GCC optimize("unroll-loops") #include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" using namespace __gnu_pbds; using ll = long long; // #define int ll using namespace std; using pii = pair<int, int>; using vint = vector<int>; using vpii = vector<pii>; us...
C++
2508a347f02aa0f49e0d154c54879b13
4926a971a150b1a2ac2b91b4dabdab2f
2,300
PASSED
//#pragma GCC("-O3, no-stack-protector") //#pragma GCC("unroll-loops") #include <iostream> #include <algorithm> #include <cmath> #include <numeric> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <bitset> #include <cstring> #include <vector> //#include <ext/pb_ds/...
C++
2508a347f02aa0f49e0d154c54879b13
922390c64ca68c382637069885ec719a
2,300
PASSED
#include <bits/stdc++.h> using namespace std; void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LOCAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif solve(); return 0; } #define int long long const int N...
C++
2508a347f02aa0f49e0d154c54879b13
8f282d13beced25e1749ea7cd0510e20
2,300
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define x first #define y second #define sz(a) (int)a.size() #define pb push_back using namespace std; using namespace __gnu_pbds; typedef long long ll; const int K = 300, MAX = 32000000; void solve(); signed main() { ios_base::sync...
C++
2508a347f02aa0f49e0d154c54879b13
b375af8f68231245aeac182085d112f1
2,300
PASSED
#include <iostream> #include <vector> #include <algorithm> #include <queue> #include <set> #include <cmath> #include <map> #include <random> #include <unordered_map> #include <unordered_set> #include <time.h> #include <iomanip> using namespace std; //#pragma GCC optimize(3) //#pragma GCC optimize("Ofast") //#pragma GC...
C++
2508a347f02aa0f49e0d154c54879b13
4062c772f836dd10b23987263bb62433
2,300
PASSED
#include <bits/stdc++.h> //#include <bits/extc++.h> using namespace std; //#pragma GCC optimize("Ofast") //#define int long long //using namespace __gnu_cxx; //using namespace __gnu_pbds; //using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>; mt19937...
C++
2508a347f02aa0f49e0d154c54879b13
4e9324d7e3afbc380299fbd46849cf7a
2,300
PASSED
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define fi first #define se second #define sz(x) (int)(x).size() #define pb push_back typedef long long ll; typedef long double ld; using namespace std; using namespace __gnu_cxx; using namespace __gnu...
C++
2508a347f02aa0f49e0d154c54879b13
128c9e5da123a562de91f3e01b49f394
2,300
PASSED
#include <bits/stdc++.h> using namespace std; const int sq = 400; const int maxn = 1e5; const int maxA = ((sq + 10) * maxn) * 2; const int add = (int) maxA / 2; int mp[(int) maxA + 1]; #define ll long long signed main() { cin.tie(); cout.tie(); ll n; cin >> n; vector<int> a(n); for (int i = 0; ...
C++
2508a347f02aa0f49e0d154c54879b13
1d64294da26e2d7fad36741710a904dc
2,300
PASSED
#include<iostream> #include<algorithm> #include<cmath> #include<iomanip> #include<limits> #include<vector> #include<string> #include<map> #include<set> #include<unordered_map> #include<unordered_set> #include<deque> #include<random> #include<stack> #include<cassert> #include<deque> #include<random> #include<unordered_m...
C++
2508a347f02aa0f49e0d154c54879b13
6f6408e84bdb97216c3184e886f902da
2,300
PASSED
#include <bits/stdc++.h> #pragma GCC optimization("Ofast"); #pragma GCC optimization("unroll-loops"); #pragma GCC optimization("fast-math"); using namespace std; using ll = long long; const ll mod = 998244353; const ll maxn = ll(2e5)+5; const ll inf = ll(1e18); ll inv[maxn], erat[maxn]; ll gcd(ll ...
C++
178222a468f37615ee260fc9d2944aec
56246f305916bd65cfa718bd2d2e500f
2,100
PASSED
/** The_Rubbish TTTTT h RRRR b b h T T T h R R b b i h T hh e R R u u bbbb bbbb iii ssss hh T h h e e RRRR u u b b b b i s h h T h h ee RRR u u b b b b ...
C++
178222a468f37615ee260fc9d2944aec
7bf05379f4735f3325cd6128197f7e95
2,100
PASSED
#include<bits/stdc++.h> #define ll long long #define int ll #define pb push_back #define mp make_pair #define f first #define s second using namespace std; const int N = 2e5 + 100; const int inf = 998244353; void boost() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ...
C++
178222a468f37615ee260fc9d2944aec
607c27e73d272b1bc0a9a46f5b26ac41
2,100
PASSED
#include <iostream> #include <algorithm> #include <math.h> #include <set> #include <vector> #include <string> #include <map> #include <queue> #include <deque> #include <random> #define _CRT_SECURE_NO_WARNINGS using namespace std; mt19937 rnd(228337); using ll = long long; #define int long long #define ...
C++
178222a468f37615ee260fc9d2944aec
27407affa020161d39d6392675ce2fd0
2,100
PASSED
#include <iostream> #include <string> #include <vector> #include <set> #include <algorithm> #include <map> #define ll long long using namespace std; //#define int long long const int X = 1e6 + 2; const ll Mod = 998244353; pair < pair <int, int>, pair <int, int> > edges[X]; ll ans[X]; int mnp[X]; int np[...
C++
178222a468f37615ee260fc9d2944aec
29dbcbcae8eeb01582eb21b25cc81d24
2,100
PASSED
#include <bits/stdc++.h> //#define int int_fast32_t #define int long long #define fi first #define se second #define vec vector #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fast_io ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define sz...
C++
178222a468f37615ee260fc9d2944aec
bd8c9d6ec4416960b479f797af212a82
2,100
PASSED