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 mino "1030E" #define ll long long #define pb push_back #define fi first #define se second #define mp make_pair #define FOR(i,a,b) for(int i=a; i<=b; i++) #define Down(i,a,b) for(int i=a; i>=b; i--) #define FOR_(i,a,b) for(int i=a; i<b; i++) #define turbo ios_base::sync_with_stdio(0); ...
C++
d197a682b956f000422aeafd874816ce
ac177fff86d68d2b6bdf0952f07bf609
2,000
PASSED
#include <bits/stdc++.h> #include <string> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; using namespace std; #define pii pair<int, int> //#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> //#define o...
C++
d197a682b956f000422aeafd874816ce
1df0e268749d98bd826b66babdb9dc00
2,000
PASSED
#include<bits/stdc++.h> #define int long long using namespace std; main() { ios_base::sync_with_stdio(false); int n; cin>>n; vector<int>a(n); for(int i=0;i<n;i++) {cin>>a[i]; int x=0; while(a[i]>0) { if(a[i]%2==1) x++; a[i]/=2; } a[i]=x; } ...
C++
d197a682b956f000422aeafd874816ce
89223f9ddf7065928d175c2ccb1456f3
2,000
PASSED
////#include <bits/stdc++.h> ////#include <ext/pb_ds/assoc_container.hpp> ////#include <ext/pb_ds/tree_policy.hpp> //// ////#define pii pair <int,int> ////#define pll pair <long long,long long> ////#define sc scanf ////#define pf printf ////#define Pi ...
C++
2e08077d0b49c52586266ddcc12edcb5
a85d69e4a4af71f7481687f4279b7c28
2,000
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pii pair <int,int> #define pll pair <long long,long long> #define sc scanf #define pf printf #define Pi 2*acos(0.0) #define ms(a,b) ...
C++
2e08077d0b49c52586266ddcc12edcb5
8be36e496d958e4ed6f7afc719b26e4a
2,000
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pii pair <int,int> #define pll pair <long long,long long> #define sc scanf #define pf printf #define Pi 2*acos(0.0) #define ms(a,b) ...
C++
2e08077d0b49c52586266ddcc12edcb5
3f46e5f610435b9879b5e0f755291374
2,000
PASSED
#pragma GCC optimize(3,"Ofast","inline") #pragma GCC target("avx,avx2") #include <bits/stdc++.h> using namespace std; template<class t> inline t read(t &x){ char c=getchar();bool f=0;x=0; while(!isdigit(c)) f|=c=='-',c=getchar(); while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar(); if(f) x=-x;return x; } template<...
C++
2e08077d0b49c52586266ddcc12edcb5
a22e5bf388d591bc9ee66c0d60f53b35
2,000
PASSED
//in the name of ALlah #include <bits/stdc++.h> using namespace std; #define pb push_back #define pp pop_back #define pof pop_front #define puf push_front #define mpr make_pair #define ll long long #define ull unsigned ll #define ld long double #define all(v) v.begin(),v.end() #define X first #define Y second #def...
C++
2e08077d0b49c52586266ddcc12edcb5
ef8b7289611477b907db323910707fb5
2,000
PASSED
#include <bits/stdc++.h> using namespace std; #define LL long long #define Debug(x) cerr << #x << ": " << x << endl; inline int read() { char c = getchar(); int x = 0, f = 1; for (; !isdigit(c); c = getchar()) if (c == '-') f = -1; for (; isdigit(c); c = getchar()) x = x * 10 + c - '0'; return x * f; } const int...
C++
2e08077d0b49c52586266ddcc12edcb5
d8af33ab13a306ab186201f97896ef05
2,000
PASSED
//in the name of god #include <bits/stdc++.h> using namespace std; #define MAX_N (int)1e5+20 #define INF 1e9+20 #define pb push_back #define F first #define S second typedef long long LL; #define int LL typedef pair<int,int> pii; const int delta=(int)1e9+7,B=100; vector <int> ch[MAX_N]; vector <char> str; int ans,n,m,...
C++
2e08077d0b49c52586266ddcc12edcb5
783aca8d494a9d16a1b7b80f16509293
2,000
PASSED
//in the name of god #include <bits/stdc++.h> using namespace std; #define MAX_N (int)1e5+20 #define INF 1e9+20 #define pb push_back #define F first #define S second typedef long long LL; #define int LL typedef pair<int,int> pii; const int delta=(int)1e9+9,B=37; vector <int> G[MAX_N]; vector <char> c; int ans,n,m,b[3*...
C++
2e08077d0b49c52586266ddcc12edcb5
83630b61e33a0d27e09df781d2ab0090
2,000
PASSED
#pragma GCC optimize("O2") /* ____ __ / __ \____ / /_ ____ _____ ___ / /_/ / __ \/ __ \/ __ `/ __ `__ \ / _, _/ /_/ / / / / /_/ / / / / / / /_/ |_|\____/_/ /_/\__,_/_/ /_/ /_/ */ #include<bits/stdc++.h> typedef long long ll ; #define pll pair<ll , ll > #define X first #define Y second #define m...
C++
2e08077d0b49c52586266ddcc12edcb5
b23bca7bd42c53873e5741475b271cbb
2,000
PASSED
#include<math.h> #include<algorithm> #include<cstdlib> #include<iostream> #include<stdio.h> #include<map> #include<set> #include<string> #include<vector> #include<queue> #include <iterator> #include <deque> #define Pi 3.141592 #define E 0.000001 #define Pr 1000000009ll #define MA(a,b) (a>b?a:b) #define MI(a,b) (a<b?a:b...
C++
2e08077d0b49c52586266ddcc12edcb5
56e670f92c5fc1c3042352f6a6ddcc82
2,000
PASSED
#include <iostream> #include <string> using namespace std; void check(char board[101][101], int row, int collumn, int i, int j, bool* table, int* count) { if (i+1 <= row && board[i+1][j] != '.' && !table[board[i+1][j] -'A']) { table[board[i+1][j] -'A'] = true; (*count)++; } if (j+1 <= collumn && board[i][j+1...
C++
d7601c9bb06a6852f04957fbeae54925
838fef6ef2640bbbf0e03966f65805f6
1,100
PASSED
#include <iostream> #include <vector> #include <string> #include <functional> #include <math.h> #include <cstdio> #include <map> #include <queue> using namespace std; #define REP(i,n) for(int (i)=0;(i)<(n);++i) int N,M; char c; map<char,int>m; string alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int main() { for(int i=0;i...
C++
d7601c9bb06a6852f04957fbeae54925
86d66c3a54989c2165562707224ef83e
1,100
PASSED
#include<iostream> #include<set> using namespace std; int main() { char matr[102][102]; int n, m, i0, j0, i1, j1, flag=0; char PC; cin>>n>>m>>PC; for(int i=1; i<=n; i++) for(int j=1;j<=m; j++) { cin>>matr[i][j]; if(flag==0 && matr[i][j]==PC) { i0=i;j0=j;flag=1; } } int i=n; flag=1; while...
C++
d7601c9bb06a6852f04957fbeae54925
5b4585e89d619fd81d5830136d8b2cb9
1,100
PASSED
#include <iostream> #include <algorithm> #include <string> #include <vector> //#include <stack> #include <map> //#include <unordered_set> using namespace std; #define ff(i,m) for(auto i=m.begin();i!=m.end();i++) #define fr(i,m) for(auto i=m.rbegin();i!=m.rend();i++) #define f0(i,n) for(decltype(n) i=0;i<n;i++) #define ...
C++
d7601c9bb06a6852f04957fbeae54925
fece6b09dc31675c18de947291de4267
1,100
PASSED
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <algorithm> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <fstream> #include <bitset> #include <cstdlib> #include <string> #include <cstring> #include <cst...
C++
d7601c9bb06a6852f04957fbeae54925
4693171f5a67999edb93f80bbacd3c8f
1,100
PASSED
#include <iostream> #include <algorithm> #include <list> using namespace std; int main() { int n, m; char K; cin >> n >> m >> K; n += 2; m += 2; char** mas = new char*[n]; for (int i = 0; i < n; i++) mas[i] = new char[m]; for (int i = 0; i < n; i++){ for (int j = 0; j < m; j++){ mas[i][j] = '0'; } } ...
C++
d7601c9bb06a6852f04957fbeae54925
5463469c93e7f90cda920db66be04086
1,100
PASSED
#include <vector> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cm...
C++
d7601c9bb06a6852f04957fbeae54925
4bf6f13342df319ca2ce561ab1d59379
1,100
PASSED
#include <iostream> #include <vector> #include <stdio.h> #include <string.h> using namespace std; int main() { int n, m, counter = 0; int letters[27]; char arr[101][101]; vector <int> prX; vector <int> prY; char prDesk; memset(letters, 0, sizeof letters); cin >> n >> m; cin >> prDesk; for (int i = 0; i < n...
C++
d7601c9bb06a6852f04957fbeae54925
eff029b14647cf8f9af58e81600ed32e
1,100
PASSED
#include <string> #include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; int main() { map <char,int> mp; int n,m,i,j,d=0,t,res=0; char c; char color[22222]; char cab[222][222]; cin >> n >> m >> c; for (i=0;i<n+2;i++) { j=0; cab[i...
C++
d7601c9bb06a6852f04957fbeae54925
99e636d06ed5de257345db9ca1a68114
1,100
PASSED
#include <iostream> #include <stdio.h> #include <math.h> #include <vector> #include <string> using namespace std; int main() { int m,n; char color; cin>>m>>n>>color; cin.ignore(); string str; char dom[102][102]; memset(dom,'.',sizeof(dom)); bool t = 0; int x_begin,y_begin; for (i...
C++
d7601c9bb06a6852f04957fbeae54925
c7a65d2dc02077bff7a23861a8a9a07b
1,100
PASSED
/** * * @author meashish */ import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.Serializable; import java.util.InputMismatchException; public class Main { InputReader in; PrintStream out; private void start() { int n = in.nextInt(); ...
Java
a548737890b4bf322d0f8989e5cd25ac
e093a6c8c36e0655827214b3a15cb730
1,600
PASSED
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.InputMismatchException; public final class BearAndBlocks { public static void main(String[] args) { new BearAndBlocks(System.in, System.out); } static class Solver { // BufferedRe...
Java
a548737890b4bf322d0f8989e5cd25ac
733e4c43def0ef34aa8877c0cf52b71a
1,600
PASSED
import java.util.Scanner; public class BearAndBlocks { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int heights[] = new int[n + 2]; for (int i = 1; i <= n; ++i) heights[i] = scanner.nextInt(); scanner.close(); int results[] = new int[...
Java
a548737890b4bf322d0f8989e5cd25ac
56c59d9d7bc2932e9e0473573c3a046b
1,600
PASSED
import java.util.*; import java.io.*; /*NO RESPECT*/ public class Main implements Runnable { static boolean showTime = false; public void solve() throws IOException { int n = nextInt(); int[] h = new int[n]; for(int i = 0; i < n; i++) h[i] = nextInt() - 1; int[] lef...
Java
a548737890b4bf322d0f8989e5cd25ac
85797312ee04003a2c63e80e63c3702a
1,600
PASSED
//package practice; /** * Created by Rajan Waliya on 03-Sep-15. */ import java.io.*; import java.util.*; //public class D574 { Reader sc; PrintWriter out; int n; int[] h; void solve() throws IOException { n = sc.nextInt(); h = new int[n+2]; for(int i=1;i<=n;i++){ ...
Java
a548737890b4bf322d0f8989e5cd25ac
a8fb080e4ac42c21fc0a87a4c5026a96
1,600
PASSED
//package practice; /** * Created by Rajan Waliya on 03-Sep-15. */ import java.io.*; import java.util.*; //public class D574 { Reader sc; PrintWriter out; int n; int[] h; void solve() throws IOException { n = sc.nextInt(); h = new int[n+2]; for(int i=1;i<=n;i++){ ...
Java
a548737890b4bf322d0f8989e5cd25ac
41a56beed44ccf6a555360e23c3dcc3c
1,600
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; public class Main{ public static int gcd(int a, int b){ if (b == 0) return a; else return gcd(b, a % b); } public static int mcm(int a, int b...
Java
a548737890b4bf322d0f8989e5cd25ac
fc22c5642cfe4c1380ab43412a20cbb1
1,600
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.util.Arrays; import java.util.Random; import java.util.StringTokenizer; public class D { public static void main(String[] args) { FastScanner sc = new FastScanner(); int ...
Java
a548737890b4bf322d0f8989e5cd25ac
e5333650bb17e305fbc9a7c6ae2a26e5
1,600
PASSED
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class ProblemD { public static void main(String[] args){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try{ String line = br.readLine(); int size =...
Java
a548737890b4bf322d0f8989e5cd25ac
338e2921608ad86f0f7d09f9ada15902
1,600
PASSED
import java.util.Scanner; public class Main { public static long min(long x,long y){ return x<y?x:y; } public static long count(long[] original){ int n = original.length; long[] left = new long[n]; long[] right = new long[n]; long best = 1; for(int i=0;...
Java
a548737890b4bf322d0f8989e5cd25ac
d2538a64b731152222cb0d74035ed4c8
1,600
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxl=2e5+10; int n,m,cnt,tot,cas,ans; int a[maxl],b[maxl],num[maxl*32]; int ind[maxl*32],sz[maxl*32],tr[maxl*32][2]; bool vis[maxl],pr[maxl]; char s[maxl]; vector<int> e[maxl]; inline void prework() { scanf("%d",&n); for(int i=1;i<=n;i++)...
C++
c01da186ee69936eb274dce6e1222e43
dd9c5113efcec2896cc82704112ce76a
2,100
PASSED
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <iomanip> #incl...
C++
c01da186ee69936eb274dce6e1222e43
5a19087cdb0b59a1efe21c35aba085a0
2,100
PASSED
//template start// #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0); #define F first #define S second #define pb push_back #define forn(i, n) for(int i = 0; i < n; ++i) #de...
C++
c01da186ee69936eb274dce6e1222e43
0bb5c52e46b462981f6a3c4467d57024
2,100
PASSED
#include <bits/stdc++.h> #define int int64_t #define vi vector<int> #define ii pair<int,int> #define vb vector<bool> #define vvi vector<vi> #define vvb vector<vb> #define vii vector<ii> #define vvii vector<vii> #define x first #define y second #define pb push_back #define loop(i,s,e) for(int i=s;i<e;i++) #define loopr(...
C++
c01da186ee69936eb274dce6e1222e43
d0233815fc932e7302648e8abdcf6845
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long int lld; typedef pair<int,int> pi; typedef pair<lld,lld> pl; typedef long double ld; typedef vector<int> vt; typedef vector<vt> vtt; #define x first #define y second #define all(v) v.begin(), v.end() #define sz(x) (int)x.size() #define mk(a,b) make_pair(a,...
C++
c01da186ee69936eb274dce6e1222e43
e04a891a045248e183a20be0b0c7e90a
2,100
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e5+7; vector<int>num[31]; int dfs(vector<int>v,int x) { if(x==-1) return v.size(); if(v.size()<=2) return v.size(); vector<int>v0,v1; for(int i=0;i<v.size();i++) { if(v[i]&(1<<x)) v1.push_back(v[i]); ...
C++
c01da186ee69936eb274dce6e1222e43
0352965371c0b65349bc334941fe41ec
2,100
PASSED
#include <bits/stdc++.h> using namespace std; int Solve(int *a, int *b) { if (b - a == 1) return 1; int k = 1 << __lg(*a ^ *(b - 1)); int *c = partition_point(a, b, [&](int x) { return (x & k) == 0; }); return 1 + max(Solve(a, c), Solve(c, b)); } int main(){ int n; cin >> n; int a[n]; for (int i = 0; i < n; +...
C++
c01da186ee69936eb274dce6e1222e43
29ebe14d6977f423f435c2b3651f7058
2,100
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 200005; int tr[N*30][2], cnt[N*30]; int ne = 2; const int LG = 29; void add(int val, int to_add) { int p = 1; for(int b = LG; b >= 0; b--) { int c = val >> b & 1; if(!tr[p][c]) tr[p][c] = ne++; p = tr[p][c]; cnt[p] += to_ad...
C++
c01da186ee69936eb274dce6e1222e43
f3991b69f03bf20a1ea9f84a2fe06cfc
2,100
PASSED
#include<bits/stdc++.h> using namespace std; int c = 1; int dp[40*200005],tr[40*200005][2]; int ara[200005]; void tin(int x) { int v = 0; for(int i=31;i>=0;i--) { if(x&(1<<i)) { if(!tr[v][1]) tr[v][1] = c++; v = tr[v][1]; } else { if(!tr[v][0]) tr[v][0] = c++; v = tr[v][0]; } } dp[v] = 1...
C++
c01da186ee69936eb274dce6e1222e43
94b0c36f08b4574cfd1312695459b114
2,100
PASSED
#include <bits/stdc++.h> using namespace std; #define MAXN 200010 int n, a[MAXN]; bool vis[MAXN]; void read(){ scanf("%d", &n); for(int i = 1; i <= n; ++i) scanf("%d", a + i); sort(a + 1, a + 1 + n); } int solve(int l, int r, int k){ if(l >= r) return 0; int mid; for(mid = l; mid <...
C++
c01da186ee69936eb274dce6e1222e43
8b3795fc0bc3269a1fb7739b97e1b176
2,100
PASSED
#include <iostream> #include <vector> using namespace std; int main(void) { int n, a; cin >> n; vector<bool> v(n, false); for (int i = 0; i != n; ++i) { cin >> a; if (a <= n) v[a-1] = true; } a = 0; for (int i = 0; i != n; ++i) a += v[i]; cout << ...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
c733b4c93b1ef33d9e4827a2ed8471d1
1,000
PASSED
#include <algorithm> #include <cctype> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <sstream> #include <utility> #include <vector> using namespace std; #define REP...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
de6541a1f5b2f8471250ec774d81d260
1,000
PASSED
#include <iostream> #include <string> #include <vector> #include <map> #include <iomanip> #include <algorithm> using namespace std; int arr[1000001]; int main() { int n,a=0; cin>>n; vector<int> v(n); for(int i=0;i<n;cin>>v[i++]); sort(v.begin(),v.end()); for(int i=1;i<=n;i++) for(int j=0;j<v.size();j++) if(v[j]==i) ...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
abcfcff796ba168424dfae608c0acaad
1,000
PASSED
// by soshika #include <cstring> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmat...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
b9672e73f7dcc8bdc275c1c2665fc9db
1,000
PASSED
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; //vector<int>v(n); set<int>s1; set<int>s2; int tot=n; for(int i=0;i<n;i++) { int x; cin>>x; s1.insert(x); s2.insert(i+1); } set<int>::iterator it2=s2.begin(); set<int>:...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
e67c1e6df89b2e2b234a2fafb25fe1d5
1,000
PASSED
//4055758 Jul 12, 2013 8:25:21 PM fuwutu 137B - Permutation GNU C++0x Accepted 15 ms 0 KB #include <iostream> #include <algorithm> using namespace std; int main() { int n, a, appear[5001] = {0}; cin >> n; for (int i = 0; i < n; ++i) { cin >> a; if (a <= n) { ap...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
fc3b15bf4396eafaeca9b90a218fba3b
1,000
PASSED
//////////////////////////////////////////////////////////////// ////////////////// Sa1378 Platform Vesion 1.1 ////////////////// //////////////////////////////////////////////////////////////// #include <bits/stdc++.h> using namespace std; #define what_is(x) cerr << #x << " is " << x << endl; #define INF (1000*1000*1...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
c753cbcafef87e053a5ddb3e17c1bb29
1,000
PASSED
#include <iostream> #include <string> using namespace std; int main() { int n; int a[5010]; bool b[5010]; for (int i = 1; i < n+1; i++) b[i] = false; cin >> n; int cnt = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; if ((!b[a[i]])&&(a[i...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
a2877e293701c6a8fb778df8a1346583
1,000
PASSED
#include <bits/stdc++.h> using namespace std; const int modo=10000007,LL=1e-9; int main(){ int n,ans=0; cin>>n; int vis[5006]={}; for(int i=0;i<n;i++) { int a; cin>>a; vis[a]++; } for(int i=1;i<=n;i++) if(!vis[i]) {ans++;cerr<<ans<<endl;} cout<...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
537f9e53d7128b43e2a6da4339d6bf24
1,000
PASSED
#include<iostream> #include<algorithm> #include<stdio.h> #include<cstdio> #include<string> #include<stack> #define vi vector<int> #define ii pair<int, int> #define vii vector<ii> #define si set<int> #define msi map<string, int> #define pb push_back #define mp make_pair #define fi first #define se second #define ll lo...
C++
bdd86c8bc54bbac6e2bb5a9d68b6eb1c
6bfe6501e9e660a8ca62eb03f5fffbd3
1,000
PASSED
#include<stdio.h> #include<string.h> int main() { int t,i,j,l; char s[1000][1000]; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%s",s[i]); } for(i=0;i<t;i++) { l = strlen(s[i]); for(j=0;j<l;j = j+2) { printf("%c",s[i][j]); } if(l%2...
C
ac77e2e6c86b5528b401debe9f68fc8e
1e4a43ef962e80ed64885ed27c3d08db
800
PASSED
#include<stdio.h> #include<string.h> int main() { int t,i,a,b; char string[100]; scanf("%d",&t); for(i=1;i<=t;i++) { scanf("%s",string); a=strlen(string); printf("%c",string[0]); for(b=1;b<a-1;b=b+2) { printf("%c",string[b]); } pri...
C
ac77e2e6c86b5528b401debe9f68fc8e
4662c80d6aaca2aa9e8dab32173b74fc
800
PASSED
#include<stdio.h> #include<string.h> int main() { int t,i,a,b; char string[100]; scanf("%d",&t); for(i=1;i<=t;i++) { scanf("%s",string); a=strlen(string); printf("%c",string[0]); for(b=1;b<a-1;b=b+2) { printf("%c",string[b]); } pri...
C
ac77e2e6c86b5528b401debe9f68fc8e
ca28a905c7ece727a19ff4c6f3867bde
800
PASSED
#include<stdio.h> #include<string.h> int main(){ int n; scanf("%d",&n); while(n--){ char a[101]; int c; scanf("%s",&a); c=strlen(a); for(int i=0;i<c;){ if(a[i]=...
C
ac77e2e6c86b5528b401debe9f68fc8e
81f551abfe4c988d84bc3986d943c028
800
PASSED
#include <stdio.h> #include <string.h> int t, i, j, n, k; char a[101], b[101]; int main() { scanf("%d", &t); for(i=0; i<t; i++) { scanf("%s", &b); n=strlen(b); if(n==2) printf("%s\n", b); else { a[0]=b[0]; k=1; for(j=1; j<n-2; j=j+2) { a[k]=b[j]; k++; } a[k]=b[n-1]; for(j=0; j<=...
C
ac77e2e6c86b5528b401debe9f68fc8e
da856ee23dd3141aac010c44939a624f
800
PASSED
#include<stdio.h> #include<string.h> int main(){ char a[100]; int i,t,l; scanf("%d",&t); while(t!=0){ scanf("%s",a); l=strlen(a); for(i=0;i<l;i++){ if(i%2==1||i==0){ printf("%c",a[i]); } } printf("\n"); t--; } }
C
ac77e2e6c86b5528b401debe9f68fc8e
37be7b3b35427fa20ca8b634056072fe
800
PASSED
#include<stdio.h> #include<stdlib.h> #include<string.h> struct arry { char *ch; }; char *original(char *arr,int l) { int i,k=0; char *c=(char *)malloc(100*sizeof(char)); for(i=0;arr[i]!='\0';i+=2) { c[k++]=arr[i]; } c[k++]=arr[l-1]; c[k++]='\0'; return c; free(c); } int main() { int t; scan...
C
ac77e2e6c86b5528b401debe9f68fc8e
450002142b6bb0d13f88c225db16a503
800
PASSED
#include<stdio.h> int main() { int n; scanf("%d",&n); while(n--) { int l; char s[100]; scanf("%s",s); l=strlen(s); printf("%c",s[0]); for(int i=0;i<l-1;i++) { i=i+1; printf("%c",s[i]); } printf("\n"); }...
C
ac77e2e6c86b5528b401debe9f68fc8e
eabbbcb73adba64bf0348eedccd81276
800
PASSED
#include<stdio.h> #include<string.h> main() { int i,l,n,j; scanf("%d",&n); char s[100],t[100]; for(i=0;i<n;i++){ scanf("%s",&s); l = strlen(s); for(j=0;j<l-2;j++){ if(j%2==0){ printf("%c",s[j]); } ...
C
ac77e2e6c86b5528b401debe9f68fc8e
ac6d9eb734fa2b412f7b14142da9bea6
800
PASSED
#include<stdio.h> #include<string.h> main() { int i,l,n,j; scanf("%d",&n); getchar(); char s[100],t[100]; for(i=0;i<n;i++){ scanf("%s",&s); getchar(); l = strlen(s); for(j=0;j<l-2;j++){ if(j%2==0){ printf("%c",s[j])...
C
ac77e2e6c86b5528b401debe9f68fc8e
74470386fc9f111db5926502f2a6a561
800
PASSED
#include<bits/stdc++.h> using namespace std; #define lli long long int #define pii pair<int,int> #define vi vector<int> #define vii vector<pair<int,int>> #define vll vector<lli> #define pb push_back #define mp make_pair #define ss second #define ff first #define all(x) x.begin(),x.end() const lli mod = 1e9+7; //#i...
C++
6e9c2236e24336fcca0723e656e664cc
9953ae83e86f2acfd6be2f3b09f693fc
1,500
PASSED
/* _____ _____ .____ __ __ _____ _____.___.______________________________ / _ \ ______ / _ \ | | / \ / \/ _ \\__ | |\____ /\____ /\____ / / /_\ \ / ___/ / /_\ \| | \ \/\/ / /_\ \/ | | / / / / / / / | \\___ \ / | ...
C++
6e9c2236e24336fcca0723e656e664cc
1095c476e964f48eb060e6aabbe42230
1,500
PASSED
// SABKA BAP HAI APUN .. (SAMJE NAA) SABKA BAP ,,,,BHAVIK ASHISH PATALIA #include <bits/stdc++.h> #define ll long long #define MOD 998244353 #define maxx ((ll)1e6+5) #define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define test ll t; cin>>t; while(t--) #define int long long const int N=500005; ll fpow(ll ...
C++
6e9c2236e24336fcca0723e656e664cc
6d2f1a424c594d5fcb402bfce24b1841
1,500
PASSED
#include<bits/stdc++.h> #define pii pair<int, int> #define N 1010 using namespace std; struct ar { int value, x, y; }; int a[N][N], d[N][N], v[N][N]; int row, column; int x[] = {1, -1, 0, 0}; int y[] = {0, 0, 1, -1}; bool check(int r, int c) { return (r >= 0) && (r < row) && (c >= 0) && (c < column); } int ...
C++
6e9c2236e24336fcca0723e656e664cc
42cae63191a0f8f3b24a4663003dc261
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define int long long #define F first #define S second int32_t main(){ IOS; int n,m; cin>>n>>m; vector <string> v(n); for(int i = 0;i<n;i++) cin>>v[i]; pair <int,int> ...
C++
6e9c2236e24336fcca0723e656e664cc
b614d13b35aae1076f00026a6377e49f
1,500
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define df(b, e) ((b) > (e)) #define fore(i, b, e) for(auto i = (b) - df(b, e); i != e - df(b, e); i += 1 - 2 * df(b, e)) #define sz(x) (int) x.size() #define all(x) x...
C++
6e9c2236e24336fcca0723e656e664cc
6534d76fa7950ec25023c644cbf71292
1,500
PASSED
#include<bits/stdc++.h> #define fi first #define se second using namespace std; long long inp[1000][1000]; long long cntt[1000][1000]; long long c,r; long long vs[1000][1000]; queue<pair<pair<long long , long long> , long long > > BFS; void bfs(long long x, long long y, long long cnt) { if(inp[x][y]==-1||x<0||y<0||x>...
C++
6e9c2236e24336fcca0723e656e664cc
b6a15119b8ea6040d5e4b7e6a2a13cf1
1,500
PASSED
#include<bits/stdc++.h> #include<iostream> using namespace std; #define int long long int #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) #define all(x) (x).begin(), (x).end() #define fi first #define se second #define mp mak...
C++
6e9c2236e24336fcca0723e656e664cc
9ff23448b92346a7bc18189215ccaedf
1,500
PASSED
#include<bits/stdc++.h> using namespace std; typedef int ll; typedef vector<ll> vl; typedef pair<ll,ll> pll; #define INF 1e12 int main() { ios::sync_with_stdio(0); cin.tie(0); ll v,x,y,e,a,b,in=0; pll h; cin>>a>>b; char z,m; char ch[a][b]; pair<ll,ll>r; pll init; pll fin; vector<pll> en; map<pair<l...
C++
6e9c2236e24336fcca0723e656e664cc
7b54ec32a4c9d6355bdee8f4576067fe
1,500
PASSED
#include<bits/stdc++.h> #define ll int using namespace std; #define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define mp make_pair #define fi first #define se second #define pb emplace_back #define endl "\n" #define maxpq priority_queue<ll> #define minpq priority_queue<ll, vector<ll>, greater...
C++
6e9c2236e24336fcca0723e656e664cc
dade0d597b88fef87becc7e75eb63c69
1,500
PASSED
#include<iostream> #include<cstdio> using namespace std; const int p=100005,mod=1000000007; bool heshu[p]; int cnt[p],ans,tong[p],n,T,k,r,miu[p],que[p],m; inline int pow(int a,int b){ int t=1,y=a; while (b){ if (b&1) t=(long long)t*y%mod; y=(long long)y*y%mod; b>>=1; } return t; } inline int read()//读入一个正数 {...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
da5a715ffecc95c36088d556c5eb29ac
2,000
PASSED
/* @Author: wchhlbt @Date: 2017/4/28 */ #include <bits/stdc++.h> #define Fori(x) for(int i=0;i<x;i++) #define Forj(x) for(int j=0;j<x;j++) #define maxn 100007 #define inf 0x3f3f3f3f #define ONES(x) __builtin_popcount(x) using namespace std; typedef long long ll ; const double eps =1e-8; const int mod = 1000...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
66db4e8b72e53a42708b2f71f3de0fdb
2,000
PASSED
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <assert.h> #define IOS ios::sync_with_stdio(false) using namespace std; #define inf (0x3f3f3f3f) typedef long long int LL; #include <iostream> #include <sstream> #include <vector> #include <set> #include <map> #incl...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
bf4410001088347ace9947a54f1cdca0
2,000
PASSED
#include <cstdio> const int MAXN = 100005, MOD = 1000000007; int N, a[MAXN], pow2[MAXN] = {1}, cnt[MAXN] = {0}; struct NumberTheory { bool isPrime[MAXN]; int primeCount, primeList[MAXN], mu[MAXN]; NumberTheory() { isPrime[1] = false; mu[1] = 1; for (int i = 2; i < MAXN; ++i) isPrime[i] = true; primeCount =...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
38a79a52d23d60aaa4e39924599eaf9f
2,000
PASSED
#include<cstdio> const int N=100010,P=1000000007; int n,m,i,j,t,a[N],f[N],pow[N],ans; int main(){ scanf("%d",&n); for(pow[0]=i=1;i<=n;i++)pow[i]=pow[i-1]*2%P; while(n--)scanf("%d",&i),a[i]++,m=i>m?i:m; for(i=1;i<=m;i++){ for(t=0,j=i;j<=m;j+=i)t+=a[j]; f[i]=pow[t]-1; } for(i=m;i;i--)for(j=i+i;j<=m;j+...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
b51c0bacbc46cdf948e3255d060a1bb4
2,000
PASSED
//BISMILLAHIR RAHMANIR RAHIM #include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> #include<queue> #include<set> #include <iostream> #include<stack> #include<map> #include<string> #include<vector> #include<algorithm> #define N 1000000 #define sn scanf #define pf printf #define pb push_back #define mp...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
197cdc1d78dcffd90331a32fb7cfa0f5
2,000
PASSED
#include <bits/stdc++.h> using namespace std; const int MOD = 1000 * 1000 * 1000 + 7; inline void add(int &a, int b) { a += b; if (a >= MOD) { a -= MOD; } } inline int mul(int a, int b) { return (long long)a * b % MOD; } inline int power(int x, int n) { int res = 1; while (n) { if (n & 1) { res = mul(...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
c9dc934652bbef388b25d1b2e48b0802
2,000
PASSED
//Author: Lixiang #include<stdio.h> #include<math.h> #include<stdlib.h> using namespace std; const int MOD=1000000007; const int maxn=100001; long long mod(long long a){ return a<MOD?a:a-MOD; } int gcd(int a,int b){ return b==0?a:gcd(b,a%b); } struct F{ int Q[maxn]; long long st[maxn],ans; int P[maxn],pcnt; int a...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
7690a442970989142af7b8d8bc1ed043
2,000
PASSED
#include <stdio.h> #include <bits/stdc++.h> using namespace std; const int K = 1e9 + 7; const int MAXN = 1e5 + 10; int n, m = 100000, h[MAXN] = {0}, f[MAXN]; int power(long long x, int k) { long long t = 1; for (; k; x = x * x % K, k >>= 1) if (k & 1) t = t * x % K; return t; } int main() { ios::sync_with_s...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
c20d5d773acbc7369eca3b2953830c6d
2,000
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; typedef vector<char> vc; typedef pair<int, int> pi; const int mod = 1e9 + 7; const double EPS = 1e-9; const int INF = 1 << 29; #define mp make_pair #define el putchar('\n') #define sp putchar(' ') #define Fill(a,val) memset(a...
C++
2e6eafc13ff8dc91e6803deeaf2ecea5
6faefdb1bf487c82c1aca3bcb301b7bb
2,000
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
868f81b61dff5a19ac70caa07146ee83
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
c8f9241ca3887d0916bd86d0eafa5fbd
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
25b884dfbd457e005c6d1c2c251c8645
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
030938cd4ad68f5860f28ba0d8a28849
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
9ee367d52c492231cd6f8ebdcb222615
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
6f0d0b2f9f3b289584251a7693b3016d
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
7bbb74f149b46cb86817900ad7999e7a
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
1118e4b3f2a1c01229bfea256b16c398
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
73ff1e6e315f0075d74c4185b40819fd
2,800
PASSED
//#include <stdio.h> //#include <iostream> //#include <cstring> //#include <cmath> //#include <algorithm> //#include <string> //#include <vector> //#include <map> //#include <set> //#include <queue> //#include <cstdlib> //#include <limits> //#include <iostream> //#include <sstream> //#include <unordered_set> //#include...
C++
18fefa10208ddda771a86c74f01fe2cb
b7e10a450f2ff9270d859d320992a153
2,800
PASSED
#include<bits/stdc++.h> using namespace std ; typedef long long int ll ; #define inf ll(1e16)+5 #define mod 1000000007 #define mod1 998244353 #define mod2 999983 #define N 300001 ll power(ll a,ll n,ll m) ; ll power(ll a,ll n,ll m) { if(n==0) return 1 ; ll x=power(a,n/2,m) ; if(n%2!=0) return (((a*x)%m)*(x...
C++
112a0cac4e1365c854bb651d3ee38df9
dc6f97c69e2c2848820e30e1b2351e97
null
PASSED
#pragma GCC optimize ("trapv") /////////////////////////////////////////////////////////////// // Long template from: https://github.com/Zeldacrafter/CompProg // // Feature list: // * C++14 compatibility. // * Various 'define'-shorthands and typedefs. // * Output stream that is only active with 'DEBUG'-flag set. // * I...
C++
112a0cac4e1365c854bb651d3ee38df9
27fe28d410abe7073afbdf15add80f3d
null
PASSED
//#pragma GCC optimize "trapv" #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vii; typedef pair<int, int> p; ll MOD = 1e9+7; #define rep(i,s,e) for(auto i{s}; i<e; i++) #define repr(i,e,s) for(auto i{e}; i>=s; i--) #define rep...
C++
112a0cac4e1365c854bb651d3ee38df9
d7b88c775e039f6d1111a8bd4a93caaf
null
PASSED
#include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <string> #include <sstream> #include <iomanip> #include <map> #include <unordered_map> #include <stack> #include <cstdio> #include <climits> #include <tuple> #in...
C++
112a0cac4e1365c854bb651d3ee38df9
c88984cfa3053a4e2c3257d93da85d5d
null
PASSED
// #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") #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; #define BOOST() ios_base::sync_with_stdio(false); cin.tie(NULL) #define FILL(v, x)...
C++
112a0cac4e1365c854bb651d3ee38df9
d2b609fd828a58a4cbf18be7dfcc9eeb
null
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif //taskkill /im first.exe /t /f ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); int t; c...
C++
112a0cac4e1365c854bb651d3ee38df9
829b5523583e592ec6b435bfa620374f
null
PASSED
#include<bits/stdc++.h> //pbds #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using orderedSet =tree<T, null_type, less<T>,rb_tree_tag, tree_order_statistics_node_update>; ///use less_equal in pbds template to work a...
C++
112a0cac4e1365c854bb651d3ee38df9
637744824b2546e59ce881411e776e7f
null
PASSED