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 fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const ll N = 2e2 + 5;
int n,a[N],f[N][2*N];
int main(){
... | C++ | 27998621de63e50a7d89cb1c1e30f67c | f050e7e06a1af8652950fea8b0945e27 | 1,800 | PASSED |
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const ll N = 2e2 + 5;
ll n,a[N],f[N][2*N];
void solve(){
... | C++ | 27998621de63e50a7d89cb1c1e30f67c | a3b4d411d85b4b70789ca72b911224a5 | 1,800 | PASSED |
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string.h>
#include<set>
using namespace std;
typedef long long ll;
#define scan(n) scanf("%d",&n)
const int maxn =300;
const int INF = 1e8;
int dp[maxn];
int a[maxn];
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
f... | C++ | 27998621de63e50a7d89cb1c1e30f67c | ee5dc605de4f16ec4cc26bfd5acb1565 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const int N = 1e5 + 10 ;
ll a[N];
ll prefix[N];
ll suffix[N];
int n ;
class trie {
public:
trie* child[2] ;
trie(){
child[0] = child[1] = 0 ;
}
void insert(ll x , int i = 40){
if(i == -1) return ;
int t ... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 4db4fd2516275510ab1103e74e2c9234 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define ll long long int
#define N (int)(1e5+10)
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define nd second
#define st first
#define inf mod
#define endl '\n'
#define sag (sol|1)
#define sol (root<<1)
#define ort ((bas+son... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 4736806dc4740163aea757243064fb85 | 2,200 | PASSED |
#include <bits/stdc++.h>
#define MAX 10000007
using namespace std;
typedef long long ll;
int t[MAX][2];
int cnt, root;
int newnode(){
memset(t[cnt], 0, sizeof t[cnt]);
return cnt++;
}
void init(){
cnt = 1;
root = newnode();
}
int add(ll v, int last){
int ret = newnode();
int curr = ret;
... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 1a1d0f32e17e84f2c03e21967cbd8390 | 2,200 | PASSED |
#include<bits/stdc++.h>
#define intt long long
#define fr first
#define sc second
#define ii pair<intt,intt>
#define mk make_pair
#define pb push_back
using namespace std;
intt ans=0;
struct trie {
trie* child[2];
int mx=0;
bool isLeaf;
trie() {
memset(child, 0, sizeof(child));
isLeaf = 0;
}
void insertt(in... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 0adfd262923babf9d577a5303e30838f | 2,200 | PASSED |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int n,nN;
int c[4000009][2];
long long a[100009],s,x,res=0;
void update()
{
int i,u=0;
for (i=40;i>=0;i--)
if (c[u][(x>>i)&1]==0)
{
nN++;
c[u][(x>>i)&1]=... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 255f6cc21a3d95d1c705a99fed7b83bc | 2,200 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef __int64 ll;
const int MAXN = 100005;
ll a[MAXN];
int ch[4000000][2];
int m;
int d;
int stk[50];
void update(){
int f=0;
for(int i=m-1;... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 56ca6d1f95377bf62ee8711dd74d0398 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define sz size()
#define x first
#define y second
#define mp make_pair
#define mpp(a,b,c) make_pair(make_pair(a,b),c)
#define pb push_back
#define all(v) v.begin(),v.end()
#define EPS 1e-9
#define MOD 1000000007
#define MAX 100005
typedef pair<int,int> pii;
typedef long lo... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 9ef047de40f6646be7566149b837bac0 | 2,200 | PASSED |
// #pragma comment(linker,"/STACK:102400000,102400000")
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <vector>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <stri... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 3f440b629530b158963095c9a58101fd | 2,200 | PASSED |
// #pragma comment(linker,"/STACK:102400000,102400000")
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <vector>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <stri... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 7b2e08b16cacc3c652c8aea6428a6f7b | 2,200 | PASSED |
// #pragma comment(linker,"/STACK:102400000,102400000")
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <vector>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <stri... | C++ | 02588d1e94595cb406d92bb6e170ded6 | 591a068b923612daa055f43184294927 | 2,200 | PASSED |
#include <stdio.h>
#include <cstring>
#include <iostream>
#include <string>
#include <set>
#include <vector>
using namespace std;
#define pii pair<int, int>
#define ll long long
int orig [100005];
vector<string> ans [100005];
int main () {
ios_base::sync_with_stdio (false);
int n;
cin>>n;
set <pii> S;
for (int ... | C++ | 07ae50199dd94f72313ee7675fefadb7 | e1126019ffab5dd982eeb54469809faf | 2,000 | PASSED |
#include <bits/stdc++.h>
#define endl '\n'
#define Long long long
#define forn(i, n) for(int i = 0; i < n; ++i)
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define pii pair<int, int>
#define fi first
#define se second
#define pb push_back
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.ti... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 526bddb8d5d6352004596f9702b2c5b0 | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define inf 10000
vector<int>v;
int a[100001];
void solve(int last,int now)
{
if(v.size()==0)
{
cout<<"0"<<endl;
return ;
}
else if(v.size()==1)
{
cout<<"pushStack"<<endl;
cout<<"1 popStack"<<endl;
return ;
}... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 982314a2523162adae42dfc272431ebd | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void printPOP(int c)
{
cout << c << (c?" ":"");
if(c){
cout << "popStack" << (c > 1?" ":"");
}
if(c > 1){
cout << "popQueue" << (c > 2?" ":"");
}
if(c > 2){
cout << "popFront";
}
cout << '\n';
}
pair<int,int>pa[10000... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 0a1b1af3fd4715fd2a6d901cfab81096 | 2,000 | PASSED |
#include <bits/stdc++.h>
#define DMAX 100005
using namespace std;
//ifstream cin("a.in");
//ofstream cout("a.out");
int valoari[DMAX];
int nr;
int max1,max2,max3;
int n;
int main()
{int i,x,j;
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
for(i=1;i<=n;i++)
{
cin>>x;nr=0;max1=max2=max3=0;
... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 7ecd763f3058f8fcb3e4b9b4c8e233e7 | 2,000 | PASSED |
#include <bits/stdc++.h>
#define MAX 100005
#define EPS 1e-6
#define ull unsigned long long
#define ll long long
#define inf INT_MAX
#define pi acos(-1.0)
#define ... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 634c1c381fcd6d3956c21010a872489c | 2,000 | PASSED |
//Bismillahir Rahmanir Rahim
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cctype>
#include<cassert>
#include<cstdlib>
#include<iostream>
#include<iomanip>
#include<string>
#include<sstream>
#include<algorithm>
#include<vector>
#include<stack>
#include<list>
#include<queue>
#include<set>
#include<map>
#in... | C++ | 07ae50199dd94f72313ee7675fefadb7 | fdf16a02b5e0ae7a14c33bdc95268c9b | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
vector<int>V;
vector<string>ans(n);
while(n--){
int x;cin>>x;
V.push_back(x);
}reverse(V.begin(),V.end());
priority_queue<pair<int,int> >Q;
int flag=-1;
string S[]={"pushStack","pushQueue","pushFront",... | C++ | 07ae50199dd94f72313ee7675fefadb7 | a3dbf1177bca0f65cec27046fa407a64 | 2,000 | PASSED |
#pragma comment(linker, "/STACK:102400000,102400000")
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iom... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 301a51b21114ef7d18bc9354faf66e91 | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
//typedefs
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <int, pii> piii;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef pair <ll, ll> pll;
const double PI = acos(-1);
//defines
#define MP make_pair
#define PB push... | C++ | 07ae50199dd94f72313ee7675fefadb7 | 4535a171dabd03c0fd8a51b7517c092c | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int t,a,b;
cin>>t;
while(t--){
cin>>a>>b;
cout<<a+b<<endl;
}
return 0;
} | C++ | 27ddccc777ef9040284ab6314cbd70e7 | 33fdf82ae671235acb9fbce36b522f5b | 800 | PASSED |
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
// std::cout << "Hello World!";
int arr[20000],a;
// cout<<" no of input : ";
cin>>a;
int r=2*a;
for(int i=0;i<r;i++)
{
cin>>arr[i]; cout<< "\n";
}
for(int p=0;p<r;p+=2)
{ //int f=0;
cout<<arr[p]+arr[p+... | C++ | 27ddccc777ef9040284ab6314cbd70e7 | d791b4fe1a3b9a0d56098adf24a27912 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
for(int t=1; t<=T; t++){
int a, b;
cin >> a >> b;
cout << a+b << endl;
}
return 0;
}
| C++ | 27ddccc777ef9040284ab6314cbd70e7 | 3b2da90858335105c0e76cdd30302984 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
for(int t=1; t<=T; t++){
int a, b;
cin >> a >> b;
cout << a+b << endl;
}
return 0;
}
| C++ | 27ddccc777ef9040284ab6314cbd70e7 | f838b57825d2fac9c870c2fdabcf5b3b | 800 | PASSED |
#include <iostream>
using namespace std;
int main()
{
long a, b, n;
cin >> n;
for (long i = 0; i < n; i++)
{
cin >> a >> b;
cout << a + b << "\n";
}
return 0;
}
| C++ | 27ddccc777ef9040284ab6314cbd70e7 | c8516a13ed0a1e9fec91f6a7d7955e82 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define forn(i,a,b); for(int i=a;i<=b;i++)
#define e '\n'
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main(){
FAST
int t;
cin >> t;
while(t--){
int a,b;
cin >> a >> b;
cout << a + b << e;
}
ret... | C++ | 27ddccc777ef9040284ab6314cbd70e7 | 37d0778a62cc2dafa30675dbcf42ea44 | 800 | PASSED |
#include<bits\stdc++.h>
using namespace std;
int main()
{
int t,a,b,s;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&a,&b);
s=a+b;
printf("%d\n",s);
}
}
| C++ | 27ddccc777ef9040284ab6314cbd70e7 | 5077895ac239160f3936963aba12db89 | 800 | PASSED |
#include<bits\stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
printf("%d\n",a+b);
}
}
| C++ | 27ddccc777ef9040284ab6314cbd70e7 | 0ce184fcd7c106ff805d7a2ed597dba1 | 800 | PASSED |
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{ int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}
}
| C++ | 27ddccc777ef9040284ab6314cbd70e7 | b8e2726e37e9053203cbc45187c240da | 800 | PASSED |
#include<bits/stdc++.h>
#include <climits>
using namespace std;
typedef long long ll;
#define PI 3.14159265
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
while(T > 0){
int a, b;
cin >> a >> b;
cout << a + b << endl;
T--;
}
} | C++ | 27ddccc777ef9040284ab6314cbd70e7 | c521e80fed8fc5df28f58656cc48c1cb | 800 | PASSED |
t = int(input())
for _ in range(t):
a,b,c,n = map(int, input().split())
m = max(a,b,c)
for i in [a,b,c]:
p = m-i
i+=p
n-=p
if n%3==0 and n>=0:
print("YES")
else:
print("NO")
| Python | bc5fb5d6882b86d83e5c86f21d806a52 | 01617e2eb58b355f44572170c03385c0 | 800 | PASSED |
for i in range(int(input())):
a,b,c,n=map(int,input().split())
if (a+b+c+n)%3 ==0:
k=(a+b+c+n)//3
if k>=a and k>=b and k>=c:
print("YES")
else:
print("NO")
else:
print("NO") | Python | bc5fb5d6882b86d83e5c86f21d806a52 | 74285b7f875014baa9030ad7b79548e9 | 800 | PASSED |
n1 = int(input())
while(n1>0):
a,b,c,n = [int(x) for x in input().split()]
maximum = max(a,b,c)
p = a + b + c + n
if(p%3 == 0 and p/3 >= maximum):
print("YES")
else:
print("NO")
n1 -=1 | Python | bc5fb5d6882b86d83e5c86f21d806a52 | 2de37f5ce6078413d0fc5ba3de8f73b6 | 800 | PASSED |
t = int(input())
for _ in range(t):
a = list(map(int, input().split()))
d = max(a[0], a[1], a[2])
sum = 3 * d - a[0] - a[1] - a[2]
if (a[-1] - sum) % 3 == 0 and a[-1] - sum >= 0:
print("YES")
else:
print("NO") | Python | bc5fb5d6882b86d83e5c86f21d806a52 | 551304622838b6d3c77cf60ea62ff991 | 800 | PASSED |
t = int(input())
for _ in range(t):
l = list(map(int,input().split()))
n = l.pop()
l.sort()
a,b,c = l
if n > 2*c-b-a:
x = 2*c-b-a
if (n-x)%3 ==0:
print('YES')
else:
print('NO')
elif n == 2*c-b-a:
print('YES')
else:
print('NO')
... | Python | bc5fb5d6882b86d83e5c86f21d806a52 | 86e5c9073d18dbb7fa57653273074b4b | 800 | PASSED |
t=int(input())
while(t>0):
t=t-1
a,b,c,n=map(int,input().split())
s=a+b+c+n
k=s/3
if(k==s//3):
if((k>=a and k>=b and k>=c)and ((k-a)+(k-b)+(k-c)==n)):
print("YES")
else:
print("NO")
else:
print("NO")
| Python | bc5fb5d6882b86d83e5c86f21d806a52 | 75974934d03e0df1f89dd5eb607b3126 | 800 | PASSED |
n = int(input())
nabors = []
for i in range(n):
m = input().split(' ')
a,b,c,x = m
nabors.append([int(a), int(b), int(c), int(x)])
# nabors = [[1,2,8, 4]]
for i in nabors:
mon = i[:3]
n = i[3]
mon.sort(reverse=True)
a, b, c = mon
x = n - (a-c) - (a-b)
if x % 3 == 0 and x >= 0:
... | Python | bc5fb5d6882b86d83e5c86f21d806a52 | b20c666c4445cc03ce27154543cf7dfd | 800 | PASSED |
def get_coeffs(a, b, c, n):
res = []
res.append((b + c + n - 2 * a) / 3)
res.append(res[0] + a - b)
res.append(res[0] + a - c)
return res
num_samples = input()
for i in range(0, int(num_samples)):
sample = input()
sample_arr = sample.split(" ")
a = int(sample_arr[0])
b = int(samp... | Python | bc5fb5d6882b86d83e5c86f21d806a52 | a74359e32d828fe9b157790162ed15cb | 800 | PASSED |
k = int(input())
for i in range(k):
a,b,c,n = map(int, input().split())
a,b,c=sorted([a,b,c])
if ((a+b+c+n)%3==0)&(abs(c-b)+abs(c-a)<=n):
print('YES')
else:print('NO')
i+=1
| Python | bc5fb5d6882b86d83e5c86f21d806a52 | ed8fa2d5963510538e6c9d91e59ea93f | 800 | PASSED |
num = int(input())
for i in range(num):
nums = [int(n) for n in input().split()]
n = nums[3]
coins = nums[:3].copy()
aukaat=False
i = 0
while (sum(coins) != 3 * max(coins) and n != 0):
add=max(coins)-coins[i]
if (coins[i] == max(coins)):
i += 1
continue
... | Python | bc5fb5d6882b86d83e5c86f21d806a52 | b82696af8c20996060715f1b028f77b4 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
/*** Typedef ***/
typedef long long ll;
//typedef int ll;
typedef unsigned long long ull;
typedef long double ld;
///typedef complex<ld> P;
//#define X real()
//#define Y imag()
//ld restant(P p)
//{
// return abs(p);
//}
//polar(x,y) mag=l,arg=y
//ty... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | a519c13fc7d7bf23bfe9e244e1f5ca23 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
/*** Typedef ***/
typedef long long ll;
typedef unsigned long long ull;
/*** Loops ***/
#define ff1(i,a,b) for(ll i = a; i <b; i++)
#define ff2(i,a,b) for(ll i = b-1; i >= a; i--)
#define ff3(i,a,b,m) for(ll i = a; i <=b; i+=m)
#define foRev(num) for(ll i = num - 1; i >= 0... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 8d008bc32b423bba384613123882c72e | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
/*** Typedef ***/
typedef long long ll;
//typedef int ll;
typedef unsigned long long ull;
typedef long double ld;
///typedef complex<ld> P;
//#define X real()
//#define Y imag()
//ld restant(P p)
//{
// return abs(p);
//}
//polar(x,y) mag=l,arg=y
//ty... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | a7671c9bff1761ed0481c2a082aeb8f5 | 1,300 | PASSED |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
int x,y,z;
int n;
cin>>n;
while(n--)
{
cin>>x>>y>>z;
x--;
y--;
z=(z)%(y-x+1);
string s1=s.substr(y-z+1,z);
... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 1bc5bb1c7d4a8d1fc88998e9d339b173 | 1,300 | PASSED |
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cctype>
#include <set>
using namespace std;
#define debug(var) \
cout << "[DEBUG] " << #var << " = " << var << endl
int main(int, char**)
{
string s;
cin >> s;
int m;
cin >> m;
while (m--) {
int l, r, k;
cin >> l >> r ... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 8d273f10ed32a6e66e92622461fff680 | 1,300 | PASSED |
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s, s1;
int l, r, n, cnt = 0, k, j;
cin >> s;
s1 = s;
cin.ignore();
cin >> n;
while (cnt<n)
{
cin >> l >> r >> k;
l -= 1;
r -= 1;
for (int i = l; i <= r; i++)
{
j = ((i - l + k) % (r - l + 1)) + l;
s1[j] = s[i];
}
fo... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 524e85ccd214efcfe75b141042589bec | 1,300 | PASSED |
#include<iostream>
#include<queue>
#include<vector>
#include<string>
#include<unordered_map>
#include<list>
#include<unordered_set>
#include<cctype>
int main() {
std::string s;
std::cin >> s;
int m;
std::cin >> m;
while (m--) {
int l, r, k;
std::cin >> l >> r >> k;
int len = r - l + 1;
k %= len;
--l... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 9335f985573e5dcb91a16120917e93e4 | 1,300 | PASSED |
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main (){
string s;int t; cin >>s>>t;
int l,r,k; if (s.size()==1){cout <<s;return 0;}
while(t--){
// cin>>l>>r>>k;
scanf("%d%d%d",&l,&r,&k);
if (r-l+1==0)continue;k%=r-l+1;
while(k--){
s.insert(l-1,1,s[r-1]);
... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 2ac38766392221aeddcf33c129ec6e68 | 1,300 | PASSED |
#include<iostream>
#include<string>
#include<cstring>
#include<vector>
#include<cmath>
#include<iomanip>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
#include <fstream>
#include <set>
#include <list>
using namespace std;
#define ll long long
#define ld long double
#define mp make_pair
#define al... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | 39589ca12d03503287d07877767bd1da | 1,300 | PASSED |
#include <iostream>
#include <string>
#include<stdio.h>
using namespace std;
string s; int t,t1,t2,t3;
int main (){
cin>>s;
scanf("%d" ,&t);
while (t--){
scanf ("%d%d%d" , &t1,&t2,&t3);if(t2-t1+1 != 0) t3%=t2-t1+1;
for (int i=0;i<t3;i++){
s.insert(s.begin()+t1-1,s[t2-1]);
s.erase(s.begin()+t2-1+1)... | C++ | 501b60c4dc465b8a60fd567b208ea1e3 | efdae1f37771262f7db38ee87808b58c | 1,300 | PASSED |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Anton_And_Danik
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
string x = Console.ReadLine();
... | C# | 0de32a7ccb08538a8d88239245cef50b | 3004bafe0275fa94ebb50245ed231958 | 800 | PASSED |
using System;
namespace problem {
class Program {
static void Main(string[] args) {
int i, c = 0;
string[] input1 = Console.ReadLine().Split();
var n = int.Parse(input1[0]);
string input2 = Console.ReadLine();
char[] resultList = input2.ToCharArray... | C# | 0de32a7ccb08538a8d88239245cef50b | 7d501ad845cb83026b8a8756900e7208 | 800 | PASSED |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
Console.ReadLine();
var a = Console.ReadLine();
var p1 = 0;
... | C# | 0de32a7ccb08538a8d88239245cef50b | 897f7a1ba9ca7a0fafeec9834ffb7497 | 800 | PASSED |
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
namespace Codeforces
{
class Program : IDisposable
... | C# | 0de32a7ccb08538a8d88239245cef50b | 09ec24ec78e3a15d369a38f350ffee9d | 800 | PASSED |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace Contest_379_div2_A
{
class Program
{
static void Main(string[] args)
{
int i1 = 0;
using (StreamReader r = new StreamReader(Con... | C# | 0de32a7ccb08538a8d88239245cef50b | 558120fc1778d37f0e54f821f44e6b03 | 800 | PASSED |
using System;
class Program
{
static void Main(string[] args)
{
string[] input = Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
int a = 0;
int d = 0;
for (int i = 0; i < input[1].Length; ++i)
... | C# | 0de32a7ccb08538a8d88239245cef50b | 733b07048a52d303dbf417b23ef53813 | 800 | PASSED |
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var n = Int32.Parse(Console.ReadLine());
var str = Console.ReadLine().ToCharArray();
var s = 0;
foreach (var i in str)
if (i == 'A')
... | C# | 0de32a7ccb08538a8d88239245cef50b | c9484090048816150f87b2555b8112de | 800 | PASSED |
using System;
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
string b = Console.ReadLine();
int dan = 0;
int ant = 0;
for (var i = 0; i < b.Length; i++)
... | C# | 0de32a7ccb08538a8d88239245cef50b | 20821d23f3475ae2c81cd27bff6107a5 | 800 | PASSED |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _734A
{
class Program
{
static void Main(string[] args)
{
int n = Int32.Parse(Console.ReadLine()), countWinOne, countWinTwo;
string s = Console.ReadLine(), result = null;
... | C# | 0de32a7ccb08538a8d88239245cef50b | ac9c8a00001237669a3601c519a31730 | 800 | PASSED |
using System;
using System.Collections.Generic;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
int n = Int32.Parse(Console.ReadLine());
string AD = Console.ReadLine();
int A = 0;
int D = 0;
for (int i... | C# | 0de32a7ccb08538a8d88239245cef50b | 55cc44d4d8072caa52eaf872095595ea | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,i,j,k,p = 0,q,sum = 0,flag = 0;;
char ch,ch1,ch2;
// char s[100000];
string s;
cin >> s;
//scanf("%s",s);
a = s.size();
stack < char > st;
for(i = 0 ; i < a ; i++)
{
if(s[i] == '(' || s[i] == '{' || s[i] == ... | C++ | 4147fef7a151c52e92c010915b12c06b | 6f7d322069ef82de8829073950df0a36 | 1,400 | PASSED |
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <iomanip>
#include <cstring>
#include <queue>
#include <bitset>
using namespace std;
typedef long long ll;
#define pb push_back
#define all v.begin(),v.end()
const int N... | C++ | 4147fef7a151c52e92c010915b12c06b | 6ef7cfd8355d8edcab09373b09131efe | 1,400 | PASSED |
#include <iostream>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <iomanip>
#include <cstring>
#include <queue>
#include <bitset>
using namespace std;
typedef long long ll;
#define pb push_back
#define endl "\n"
#defi... | C++ | 4147fef7a151c52e92c010915b12c06b | 263c395578824f1ffb9781eac76ffdab | 1,400 | PASSED |
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 1e6+10;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
const char op[] = "<{[(";
const cha... | C++ | 4147fef7a151c52e92c010915b12c06b | 2e062c99921cc9034024b84de937ee90 | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define ld long double
#define pll pair<ll,ll>
#define PB push_back
#define MP make_pair
#define F first
#define S second
const int MOD=1000000007;
long long int inverse(long long int i){
if(i==1) return 1;
return (MOD - (... | C++ | 4147fef7a151c52e92c010915b12c06b | a2a4ae038c068c12f3c2b2d9e26690ba | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long
const int N=200005;
string str;
bool close(char c){
return ( c==')' || c=='}' || c==']' || c =='>');
}
char rev(char c){
if(c==')')
return '(';
... | C++ | 4147fef7a151c52e92c010915b12c06b | 2e56e67f355572319b18a616d5122a7e | 1,400 | PASSED |
// ¯\_(ツ)_/¯
#include <bits/stdc++.h>
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long
const int N=1e6+5,MAX=3e7,MOD=1e9+7;
using namespace std;
string str;
int ans,ans2;
char wa[4]={')',']','}','>'};... | C++ | 4147fef7a151c52e92c010915b12c06b | 22c8bb7f4d6e57f4dcc2b3e03a1f0542 | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define PUB push_back
#define PUF push_front
#define POB pop_back
#define POF pop_front
#define trace1(x) cout<<#x<<"="<<x<<endl
#define trace2(x,y) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl
#define trace3(x,y,z) cout<<#x<<"="<<x<<" "... | C++ | 4147fef7a151c52e92c010915b12c06b | 2ad510cdc4b0f281cd9f2912641d6963 | 1,400 | PASSED |
/* SHUBHAM KESHARWANI */
#include<bits/stdc++.h>
#define ll long long int
#define mod 998244353
#define fr(a,b) for(ll i=a;i<b;i++)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#pragma GCC ta... | C++ | 4147fef7a151c52e92c010915b12c06b | 398e5123d4e2a7fd33060a3c5d9b701b | 1,400 | PASSED |
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<string>
#include<time.h>
#include<math.h>
#include<queue>
#include<set>
#include<stack>
using namespace std;
int main() {
string s;
cin >> s;
int size = s.size(), count = 0;
stack<char>t;
for (int i = 0; i < s... | C++ | 4147fef7a151c52e92c010915b12c06b | 9e4c21b48c0107ab789318b632b93128 | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 4002;
const int inf = 1e9;
int n, a[N], b[N], m, ans, dp[N][N];
int main()
{
scanf("%d", &n);
for (int i = 1;i <= n;i++)
{
scanf("%d", &a[i]);
a[i] = abs(a[i]);
dp[0][i] = inf;
}
while(true)
{
if (!n) break;
int mx = 0, rem = 0;
for (in... | C++ | 7c1f7740bdac042147e969a98897f594 | 5e8d18b2ead5050c9451f172a2ecd251 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 2002;
int n, a[N], ans;
int main()
{
scanf("%d", &n);
for (int i = 1;i <= n;i++) scanf("%d", &a[i]), a[i] = abs(a[i]);
for (int i = 1;i <= n;i++)
{
int x = 0;
for (int j = i + 1;j <= n;j++) x += (a[i] > a[j]);
for (int j = 1;j < i;j++) x += (... | C++ | 7c1f7740bdac042147e969a98897f594 | b79abc28e3883b2733788bc2b13894fd | 2,200 | PASSED |
#include <iostream>
#include <cmath>
using namespace std;
int a[2010], n, ans;
int main() {
cin >> n;
for(int i = 1; i <= n; i ++)cin >> a[i], a[i] = abs(a[i]);
for (int i = 1; i <= n; i++)
{
int res1 = 0, res2 = 0;
for (int j = 1; j <= i - 1; j ++)
res1 += (a[j] < a[i]);
for (int j = i + 1; j <= n; j ++)
... | C++ | 7c1f7740bdac042147e969a98897f594 | 5f17de10998fe6c077a5c0887a018f2e | 2,200 | PASSED |
#include <bits/stdc++.h>
#define mp make_pair
#define ff first
#define ss second
using namespace std;
typedef long long ll;
int v[2005];
int main(){
int n;
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%d", &v[i]);
if(v[i] < 0) v[i] = -v[i];
}
int ans = 0;
fo... | C++ | 7c1f7740bdac042147e969a98897f594 | 1cef5059c5e123ac56d6b41e191f9203 | 2,200 | PASSED |
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <cstring>
#include <iomanip>
#define SZ(x) ((int)x.size())
#define X first
#define Y seco... | C++ | 7c1f7740bdac042147e969a98897f594 | e6340bd1a51e035e33934b8fae991ae4 | 2,200 | PASSED |
#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define repv(i,a,b) for(int i = a; i >= b; i--)
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const long long INF = 1000000000000000000ll;
#define N 2001
int tab[N], n, p... | C++ | 7c1f7740bdac042147e969a98897f594 | 50118d08d2e9493ea3f9f32897b7e5f9 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int maxN = 2005;
const int inf = 1e9;
const int mod = 1e9 + 9;
int costtoright[maxN] , costtoleft[maxN];
int main(){
// freopen("in.c","r",stdin);
int n;
scanf("%d",&n);
vector<int> numbers(n, 0);
vector< pair<int,int> > ordered;
for(int i ... | C++ | 7c1f7740bdac042147e969a98897f594 | 45972ba8abcedef60b4c18b04520d279 | 2,200 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
namespace BIT
{
int N=200000;
int bit[200005];
int lowbit(int x)
{
return x&(-x);
}
void update(int x,int val)
{
for(int i=x;i<=N;i+=lowbit(i))
bit[i]+=val;
}
int summ(int x)
{
int ret... | C++ | 7c1f7740bdac042147e969a98897f594 | 9c8870da8055e3ec740609ef61913679 | 2,200 | PASSED |
//God & me
/*
# ##### TM
# # #
# #
# #
#### #
One world, One *.****.
*/
#include <bits/stdc++.h>
#define pb push_back
#define X first
#define Y second
//#define int long long
#define in(a,n) for_each(a,a+n,[](int &x){cin>>x;})
using namespace std;
//<===LINE==#17#===>//
template <cla... | C++ | 7c1f7740bdac042147e969a98897f594 | 629202f21006fb12a80572675de3ea13 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define N 100010
vector <int> v[N];
int a[N], b[N], c[N], n;
int dp[2020][2020], mx, bb[N], cc[N];
const int INF = 1e9;
int main(){
/// freopen("a.in", "r", stdin);
scanf("%d", &n);
for(int i = 1; i <= n; i ++){
scanf("%d", a + i);
if(a[i] < 0) a[i] = - a[i];
v... | C++ | 7c1f7740bdac042147e969a98897f594 | 48d20889500190c5f60c91c190d6058f | 2,200 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Vector;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Stack;
import java.io.InputStream;
/**
* Built using CHelper plug-in
... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 6f09f5e5cdea2200fee84dd042ebcdf3 | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 72dd9342e6c7e62eed73d3f13847575e | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 379c3a4606468449a02d495340257acf | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | f59bd43cfa86119392ef7eb974d8b008 | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 13f55ba3751984b5022d6693b0536667 | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | da1969428240a5906713a93bdef95e17 | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | ecef03d06fd7e880ccad9e42e986934e | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 5e9a78704ceff50e0914bc679a40ed59 | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 7ee93811c22dedaffa10e2f937ab7d64 | 1,900 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | 38210a3dcb16ce2bbc81aa1d39d23112 | 7670688a6b5d70d240cfb6d475d7ad99 | 1,900 | PASSED |
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n,m;
struct zk
{
int u,v,next,w,id,flag;
}e[100001];
int head[100001],cnt;
void add(int u,int v,int w,int id)
{
e[cnt].flag=0;
e[cnt].u=u;
e[cnt].v=v;
e[cnt].w=w;
e[cnt].id=id;
e[... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | a941168db62d1c93b3efbca736ce5667 | 2,200 | PASSED |
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int MAXN = 200 + 5;
struct Edge {
int v, f, nxt;
Edge() {}
Edge(int v, int f, int nxt):v(v), f(f), nxt(nxt) {}
}edge[MAXN*MAX... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | f0a078be2f952369a58509777e973a58 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 210, E = N * N << 1;
int firste[N], nexte[E], v[E], d[N];
bool used[N], mp[N][N], color[E];
int e;
void build(int x, int y, int z = 1)
{
nexte[++e] = firste[x];
firste[x] = e;
v[e] = y;
color[e] = 0;
if(z)
++d[x];
}
int sta[N], route[E];
int t, n, m, to... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | 256cab53bc99971adfa75ca5d3a97cad | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int noTests;
int n, m;
set<pii> edges;
set<int> adj[220];
vector<int> newAdj[220];
void orient(int u) {
while (adj[u].size() > 0) {
int v = *adj[u].begin(); adj[u].erase(v);
adj[v].erase(u);
orient(v);
if (edges.find({u, v})... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | fb4d674129102bfdd26c1400bdac40f2 | 2,200 | PASSED |
#include<bits/stdc++.h>
#define LL long long
#define fi first
#define sd second
#define pb push_back
using namespace std;
const int N = 210;
int g[N][N],deg[N],gg[N][N];
int n , m;
int pa[N];
int Find(int x){
return pa[x] == x?x:pa[x] = Find(pa[x]);
}
vector<pair<int,int> > res;
vector<int> C[N];
void dfs(int u){
... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | f982dabb48d151fcd866ac474fc108e6 | 2,200 | PASSED |
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
using namespace std;
#define GC getchar()
#define PC putchar
inline void read(int&n)
{int x=0,f=1;char ch=GC;while(ch<'0'||ch>'9'){if(... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | 95bfa9968d29bc7c06d7b8ae496555e2 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define sf scanf
#define pf printf
#define ll long long
#define fr(I,M,N) for(I=M;I<=N;I++)
#define fr_(I,M,N) for(I=M;I>=N;I--)
#define re return
#define sfn cin>>n
#define bal pf("bal\n")
#define pb push_back
#define ins insert
#define sz(X) X.size()
#define xx first
#de... | C++ | 4f2c2d67c1a84bf449959b06789bb3a7 | 58efd202fe169ac488a3f91bb1d5f153 | 2,200 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.