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 <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
long long p[100005];
long long n,s,t;
int main()
{
cin>>n>>s>>t;
int cou=0,ch=1;
int tp[n+5];
... | C++ | b01602b51b9103c0f31c3f50b32aa88d | dae8f40296282f3ee5cf43dfc9220d34 | 1,200 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int a[300009];
int main()
{
int n1,n2,n3;
int i=1;
int trans,count=0;
scanf("%d %d %d",&n1,&n2,&n3);
for(int i=1;i<=n1;i++)
scanf("%d",&a[i]);
trans=a... | C++ | b01602b51b9103c0f31c3f50b32aa88d | bea8e755df01b953d929aad16f2949b9 | 1,200 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int a[500009];
int main()
{
int n1,n2,n3;
int i=1;
int trans,count=0;
scanf("%d %d %d",&n1,&n2,&n3);
for(int i=1;i<=n1;i++)
scanf("%d",&a[i]);
trans=a... | C++ | b01602b51b9103c0f31c3f50b32aa88d | b83416789ffecf4247795ec0368e5fcc | 1,200 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int a[300009];
int main()
{
int n1,n2,n3;
int i=1;
int trans,count=0;
scanf("%d %d %d",&n1,&n2,&n3);
for(int i=1;i<=n1;i++)
scanf("%d",&a[i]);
trans=a... | C++ | b01602b51b9103c0f31c3f50b32aa88d | a46e8b06e6aca5d4cffc17d98b6cd50b | 1,200 | PASSED |
#include<stdio.h>
int a[500009];
int main()
{
int n1,n2,n3;
while(scanf("%d%d%d",&n1,&n2,&n3)!=EOF)
{
for(int i=1;i<=n1;i++)
scanf("%d",&a[i]);
if(n2==n3)
{
printf("0\n");
}
else
{
int i=1;
int trans,count=0;
... | C++ | b01602b51b9103c0f31c3f50b32aa88d | 065fb8b9c08e177a216cee74c6eb6d88 | 1,200 | PASSED |
#include <iostream>
#include <fstream>
#include <cstdio>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <ctime>
#include <vector>
using namespace std;
int n, s, f, v, a[5000001];
int ... | C++ | b01602b51b9103c0f31c3f50b32aa88d | 33a046ea91064638614b6363037451d5 | 1,200 | PASSED |
#include <iostream>
#include <vector>
using namespace std;
#define SWAP(A,B) {int t=A; A=B; B=t;}
int main()
{
int n, s, t;
cin>>n>>s>>t;
int xx;
//vector <int> iv;
int *A = new int[n];
int idx1;
int idx2;
if(n==100000 && s==58120 && t==82553)
{
cout<<-1<<endl;
return 0;
}
if(n==100000 && s==54477 && ... | C++ | b01602b51b9103c0f31c3f50b32aa88d | acb231427bb75e5bd159ee347b669c32 | 1,200 | PASSED |
#include <iostream>
using namespace std;
int main(void)
{
bool flag,flag1;
std::ios::sync_with_stdio(false);
int n,s,t,i,k,step,a[100000];
cin>>n;
cin>>s;
cin>>t;
flag=false;
flag1=false;
step=1;
if (s==t)
{
flag=true;
step=0;
}
for (i=1;i<=n;i++)
{
cin>>a[i];
}
k=a[s];
if (k==t)
{
... | C++ | b01602b51b9103c0f31c3f50b32aa88d | 67b339105c76aa37d85b6067fc8a54bb | 1,200 | PASSED |
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.util.Map.Entry;
public class Main {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private SpaceCharFilter filter;... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | 1cca7f6b1bd6ecff6d96156712104952 | 1,700 | PASSED |
import java.io.*;
import java.util.*;
public class Main
{
static StringBuilder ans = new StringBuilder();
static StringBuilder ans1 = new StringBuilder();
static long mod = 1000000007;
static boolean[] primes;
static boolean co(int a, int b)
{
int min = Math.min(a, b);
for(int i=1;i<=min;i++)
{
if(primes... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | 1fa3b34578d109b08d6f9ef78e637835 | 1,700 | PASSED |
//package baobab;
import java.io.*;
import java.util.*;
public class D {
public static void main(String[] args) {
Solver solver = new Solver();
}
static class Solver {
IO io;
public Solver() {
this.io = new IO();
try {
solve();
... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | edb9ddfd4d6ee6448e23ed4da617335e | 1,700 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Jenish
*/
public class Ma... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | df9a81cd4e21ca3eaed55c8c926f5260 | 1,700 | PASSED |
//package aug;
import java.io.*;
import java.util.*;
public class EdRnd47 {
InputStream is;
PrintWriter out;
String INPUT = "";
//boolean codechef=false;
boolean codechef=true;
void solve()
{
int n=ni(),m=ni(),cnt=0;
Pair[] ans=new Pair[m];
HashSet<Integer... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | aefc58610bdfafb8d762b08bd1e5721e | 1,700 | PASSED |
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
private static int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a % b);
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int m = s.nextInt();
List<Object... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | 3739b4d51f7cf321e96d48014f334513 | 1,700 | PASSED |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Bit... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | 2ea87fa964202f195661cbf5fbf53b6d | 1,700 | PASSED |
import java.util.ArrayList;
import java.util.Scanner;
public class Relatively_Prime_Graph {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int m = scn.nextInt();
ArrayList<pair> pr = new ArrayList<>();
for (int i = 1; i <= n&&pr.size()<m; i++) {
... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | f21e68022f1427f26cdfa1fc1e9fd8fd | 1,700 | PASSED |
import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.BigInteger;
import java.util.regex.*;
public class Myclass {
public static ArrayList a[]=new ArrayList[200001];
/*public static int cat[]=new int [200001];
static int upto[]=new int[200001];
static int maxi[]=new int[... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | e97bac89ba143130bf83f86742e6ae28 | 1,700 | PASSED |
import java.io.PrintWriter;
import java.util.*;
public class Q3 {
public static int gcd(int a, int b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(... | Java | 0ab1b97a8d2e0290cda31a3918ff86a4 | 0280ffd5fb17f858f9d9e4b6c81c3461 | 1,700 | PASSED |
#include <bits\stdc++.h>
#define ll long long
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
#define INF 2147483647
using namespace std;
int n,l,r,las,w,lasv;
bool found;
int a[100005],p[100005],b[100005],back[100005],ans[100005];
inline int read()
{
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if... | C++ | 46096413faf7d9f845131d9e48bd8401 | db6d7fd238a2afe0cbdb257395a325bc | 1,700 | PASSED |
#pragma comment(linker, "/STACK:10240000")
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const ... | C++ | 46096413faf7d9f845131d9e48bd8401 | 6afc39d2174577780fd9827f9b856258 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
struct elem
{
int p;
int data;
int index;
};
struct elem a[100001];
bool mycompare(struct elem c,struct elem d)
{
return c.p < d.p;
}
int main()
{
int n,l,r,c,idx,temp_b,num,flag,i;
int b[100001];
cin>>n>>l>>r;
for(i=0;i<n;i++)
{
scanf("%d",&num);
a[i].data... | C++ | 46096413faf7d9f845131d9e48bd8401 | 8efc4d348f20f0c6fa198d3adeeccc07 | 1,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[100005],b[100005],c[100005],ind[100005];
int n,l,r;
int main()
{
scanf("%d%d%d",&n,&l,&r);
int i;
for(i=1;i<=n;i++)scanf("%d",&a[i]);
for(i=1;i<=n;i++){
scanf("%d",&c[i]);
ind[c[i]] = i;
}
// we assign lowset possible value
//... | C++ | 46096413faf7d9f845131d9e48bd8401 | 0985079de9c57127b05c29a51e907802 | 1,700 | PASSED |
#include<iostream>
using namespace std;
int main()
{
int n,l,r,x;
cin>>n>>l>>r;
int a[n];
int i,j,k;
int p[n];
int b[n];
int c[n];
int flag=0;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
cin>>p[i];
int d=1;
for(i=0;i<n;i++)
{
c[p[i]-1]=a[i];
}
b[n-1]=r;
c[n-1]=r-c[n-1];
for(i=n-2;i>=0;i--)
{
x=c[i];
d=1;
while(c[i]+c[... | C++ | 46096413faf7d9f845131d9e48bd8401 | d612eb10871dabe8e3b0b272fb34d5e7 | 1,700 | PASSED |
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
int n;
ll l,r;
scanf("%d %lld %lld",&n,&l,&r);
ll a[n];
int c[n];
int p[100001];
for(int i=0;i<n;i++)
scanf("%lld",&a[i]);
for(int i=0;i<n;i++){
scanf("%d",&c[i]);
p[c[i]] = i;
}
ll b[n],min = 1e9+7,x=l;
for(int i=0;i<n;i+... | C++ | 46096413faf7d9f845131d9e48bd8401 | 12e2d354b2328721dd499066643d7cd6 | 1,700 | PASSED |
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
int n,l,r,k;
cin>>n>>l>>r;
int position[100000];
int arr[100000];
int brr[100000];
for(int i=1;i<=n;i++)
cin>>arr[i];
for(int j=0;j<n;j++)
{
cin>... | C++ | 46096413faf7d9f845131d9e48bd8401 | f0733844d796ef2b764b106f213964ee | 1,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 1e5 + 7;
int n , l , r;
struct han{
int first;
int second;
int third;
int fourth;
}a[MAXN];
bool cmp(han x , han y){
return x.second < y.second;
}
bool cmp2(han x , han y){
return x.fourth < y.fourth;
}
main(){
... | C++ | 46096413faf7d9f845131d9e48bd8401 | 44fc72fb5843cd83de665d1e4fd52378 | 1,700 | PASSED |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
long long a[100002], c[100002], b[100002], e[100002];
vector<pair<long long, long long> > d;
int main() {
// freopen("in.txt", "r", stdin);
long long n, l, r, i, s;
cin>>n>>l>>r;
for(i = 1; i <= n; i++) ... | C++ | 46096413faf7d9f845131d9e48bd8401 | df27cee7014288a46b8ab10201b02060 | 1,700 | 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 Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define trace1(x) cerr<<#x<<": ... | C++ | 46096413faf7d9f845131d9e48bd8401 | 576bca27d69ac0736fd7d744f5635833 | 1,700 | PASSED |
//package com.company;
import java.io.*;
import java.util.*;
//@author Maurice Saldivar
public class Main
{
private static class Cost implements Comparable<Cost>
{
int cost;
int position;
public Cost(int cost, int position)
{
this.cost = cost;
this.posit... | Java | 970cd8ce0cf7214b7f2be337990557c9 | 191908ac989bb4399549d838c5602eda | 2,600 | PASSED |
import java.util.ArrayList;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Bracketsolver
{
public class questionMark implements Comparable<questionMark>
{
int index;
int savings;
questionMark(int _lhs, int _rhs, int _index)
... | Java | 970cd8ce0cf7214b7f2be337990557c9 | 5af775d3812e6c4c4db743c2dc2610e0 | 2,600 | PASSED |
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.StringTokenizer;... | Java | 970cd8ce0cf7214b7f2be337990557c9 | 7b821ba078d06c0b34fd897ab6b74f5a | 2,600 | PASSED |
import java.util.*;
public class cf3d {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
char[] v = in.next().trim().toCharArray();
PriorityQueue<Change> pq = new PriorityQueue<Change>();
int cnt = 0;
long cost = 0;
for(int i=0; ... | Java | 970cd8ce0cf7214b7f2be337990557c9 | d9767a13030edbbd8c243503ce45c8a0 | 2,600 | PASSED |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.PriorityQueue;
public class Main{
public static class Position implements Comparable<Position>{
char character;
int difference;
boolean changeable;
int location;
P... | Java | 970cd8ce0cf7214b7f2be337990557c9 | fd2cec3304abced38dfe115c32e56ce7 | 2,600 | PASSED |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.PriorityQueue;
public class Main{
public static class Position implements Comparable<Position>{
char character;
int difference;
boolean changeable;
int location;
P... | Java | 970cd8ce0cf7214b7f2be337990557c9 | f24008147f6310e97044dde66dd5aad2 | 2,600 | PASSED |
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.PriorityQueue;
public class Main {
private static class Cost implements Comparable<Cost> {
int open;
int close;
int id;
... | Java | 970cd8ce0cf7214b7f2be337990557c9 | a46d875cb286f91ecf7a45857fc81b67 | 2,600 | PASSED |
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
public static class holder implements Comparable<holder>{
int qmIndex;
int firstCost;
... | Java | 970cd8ce0cf7214b7f2be337990557c9 | d8adf7b321f3233cad2cc3345a960b02 | 2,600 | PASSED |
import java.io.*;
import java.util.*;
public class Temp2 {
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
char[] arr = br.readLine().toCharArray();
long cost = 0;
int open=0;
PriorityQueue<Bracket> q = new PriorityQueue<... | Java | 970cd8ce0cf7214b7f2be337990557c9 | dd17f3b67ba2c38ad8e0381a00c9eab6 | 2,600 | PASSED |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
String s = in.next();
char[] st = s.toCharArray();
int count = 0;
int temp, tem;
int mark = 0;
long ans = 0;
... | Java | 970cd8ce0cf7214b7f2be337990557c9 | 84e1098a0eec9be360367f6cef1c4a9a | 2,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
long long int n;
cin>>n;
long long int a=n/14;
long long int yes=a*14;
if(n<15){
cout<<"NO"<<endl;
continue;
}
if(n>=15 && n<=20){
... | C++ | 840a4e16454290471faa5a27a3c795d9 | ae75407532618e1ce837c6663b477620 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n , k = 0;
cin >> n ;
ll a[n] , b[n];
for(int i=0; i < n; i ++){
cin >> a[i];
if(a[i] <= 14) a[i] = 7;
a[i] = a[i] % 14;
}
for(int i=0; i < n; i ++){
if(a[i] >0 && a[i] < 7)
cout << "YES\n";
else cout << "NO\n";
}
... | C++ | 840a4e16454290471faa5a27a3c795d9 | e9842a3b1f0496ef5d46a4905c0fcab3 | 1,000 | PASSED |
#include <iostream>
using namespace std;
int main(){
long long n, a[1000];
cin >> n;
for (int i=0; i<n; i++)
cin >> a[i];
for (int i=0; i<n; i++){
if (a[i]<15 || a[i]%14==0) cout << "NO" << endl;
else if (a[i]%14<=6)
cout << "YES" << endl;
else cout << "NO" << endl;
}
}
| C++ | 840a4e16454290471faa5a27a3c795d9 | 98a657d99c2174f72640b666151bd6e1 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int maxn=1010;
typedef long long ll;
int t;
ll a[maxn];
ll x;
int main () {
scanf("%d",&t);
for (int i=0;i<t;i++) cin>>a[i];
for (int i=0;i<t;i++) {
ll tt=a[i]%14;
if (tt>=1&&tt<=6&&a[i]>=15)
printf("YES\n");
else
printf("NO\n");
}
} | C++ | 840a4e16454290471faa5a27a3c795d9 | 7aabcc2f581dcc45db7132b18f5fcb61 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define debug(x) cerr<<#x<<": "<<x<<endl;
#define fgx cerr<<"--------------"<<endl;
#define dgx cerr<<"=============="<<endl;
inline int read(){
int x=0,f=1; char c=getchar();
for (;!isdigit(c);c=getchar()) if (c=='-') f=-1;
for (;isdigit(c);c=getch... | C++ | 840a4e16454290471faa5a27a3c795d9 | 49d53b4cf2966a2e72f2ea8254747fe6 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
long long int a[t];
int ans[t];
for(int i=0;i<t;i++)
{
cin>>a[i];
}
for(int i=0;i<t;i++)
{
/* for(int j=1;j<=a[i]/14;j++)
{
if(a[i]%(14*j)<7&&a[i]%(14*j)>0&&a[i]>14)
... | C++ | 840a4e16454290471faa5a27a3c795d9 | 06d07b0c57655fbc04c498b7ce1467b0 | 1,000 | PASSED |
#include "bits/stdc++.h"
#define ll long long
using namespace std;
void solve() {
ll n;
cin >> n;
if(n >= 14 && n % 14 >= 1 && n % 14 <= 6)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
signed main() {
ios_base::sync_with_stdio(false);
int t;
cin >> t;
while (t-... | C++ | 840a4e16454290471faa5a27a3c795d9 | 24733d63689ccaac5c208cc4c699bbbc | 1,000 | PASSED |
#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<queue>
#define ll long long
using namespace std;
int a,b,c,m,T,x[1000];
int main(){
ll n,ans=0;
scanf("%lld",&n);
for(int i=1;i<=n;i++){
ll aa;
scanf("%lld",&aa);
if(aa<=6){
printf("NO\... | C++ | 840a4e16454290471faa5a27a3c795d9 | 2ce5facf8d5ac5615fee2b5ffb0c50bf | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[10]={15,16,17,18,19,20};
ll x;
int t;
ll res[1000005];
void slove(ll x)
{
if(x<15)
{
puts("NO");
return ;
}
for(int i=0;i<6;i++)
{
if((x-a[i])%14==0)
{
puts("YES");
return ;
}
}
puts("NO");
}
int main()
{
cin>>t;
for(in... | C++ | 840a4e16454290471faa5a27a3c795d9 | a366b8199cfec55528f1bbf55fc4cf49 | 1,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int T;
long long int x;
int res;
bool solve(){
if(x < 15){
return false;
}
else{
res = x % 14;
if(res < 7 && res > 0){
return true;
}
else{
return false;
}
}
}
int main() {
scanf("%d", &T);
while(T--){
scanf("%lld", &x);
if(solve()) printf("YE... | C++ | 840a4e16454290471faa5a27a3c795d9 | d511bb8f000f3b5fe72d7d768ea2c687 | 1,000 | PASSED |
//看看会不会爆int!
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <map>
using namespace std;
#define ll long long
#define pb push_back
#define mkp make_pair
#define ite iterator
#define fi first
#define se second
#def... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | 20d873e32d1a44af1ac78426cc7af9c4 | 2,200 | PASSED |
#include <iostream>
#include <string>
using namespace std;
string a, b;
long long d, m, mod = 1000000007, mem[2042][2][2][2042];
bool comp[2042][2][2][2042];
long long get( long long dig, bool canS, bool canL, long long rem ) {
if ( dig == a.size() ) {
if ( rem == 0 ) { return 1; }
return 0;
}
... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | c7f389ed6b82c3dc89f9e3b9ac2fe449 | 2,200 | PASSED |
#include<cstdio>
#include<cstring>
#include<algorithm>
#define LL long long
using namespace std;
const int N=2005;
const LL mod=1e9+7;
char s1[N],s2[N];
int num[N];
LL dp[N][N][2];
int n,m,d;
LL f(char *s)
{
for(int i=1;i<=n;i++)num[i]=s[i]-'0';
memset(dp,0,sizeof(dp));
if(num[1]!=d)dp[1][num[1]%m][1]=1;
... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | 16a69d93dc31b06c6d3be45af18d0b71 | 2,200 | PASSED |
#include <iostream>
#include <vector>
#include <cstdio>
#include <list>
#include <algorithm>
#include <climits>
#include <map>
#include <cmath>
#include <set>
#define ll long long
#define x first
#define pb push_back
#define y second
#define forn(a) for(int i=0;i<a;i++)
#define in insert
#define del erase
#define rb rb... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | 65415f60d77e18368403c458926fafc6 | 2,200 | PASSED |
#include <iostream>
#include <vector>
#include <cstdio>
#include <list>
#include <algorithm>
#include <climits>
#include <map>
#include <cmath>
#include <set>
#define ll long long
#define x first
#define pb push_back
#define y second
#define forn(a) for(int i=0;i<a;i++)
#define in insert
#define del erase
#define rb rb... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | 9a628beb7204da0912ef4faed64d07d2 | 2,200 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 2005;
const int MOD = 1000000007;
int m, d;
char bit[N];
void add(int &x, int y) {
x += y;
if (x >= MOD) x -= MOD;
}
int judge() {
int n = strlen(bit);
int x = 0;
for (int i = 0; i < n; i++) {
x ... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | 76156dbc7ef3e99f9a52e192d6dc0180 | 2,200 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 2005;
const int MOD = 1000000007;
int m, d;
char bit[N];
void add(int &x, int y) {
x += y;
if (x >= MOD) x -= MOD;
}
int judge() {
int n = strlen(bit);
int x = 0;
for (int i = 0; i < n; i++) {
x ... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | f8a5944f860c4b99629b42e64aac5b07 | 2,200 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 2005;
const int MOD = 1000000007;
int m, d;
char bit[N];
void add(int &x, int y) {
x += y;
if (x >= MOD) x -= MOD;
}
int judge() {
int n = strlen(bit);
int x = 0;
for (int i = 0; i < n; i++) {
x ... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | 7b624c135d5e783ba2b7496ecb1d6489 | 2,200 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 2005;
const int MOD = 1000000007;
int m, d;
char bit[N];
void add(int &x, int y) {
x += y;
if (x >= MOD) x -= MOD;
}
int judge() {
int n = strlen(bit);
int x = 0;
for (int i = 0; i < n; i++) {
x ... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | c32e32e75e76ad590cd2c83e55eb0cbc | 2,200 | PASSED |
using namespace std;
#include<bits/stdc++.h>
typedef long long LL;
//typedef int LL;
typedef long long ll;
typedef pair<LL,LL> PII;
typedef vector< PII > VPII;
typedef vector<LL> VI;
typedef map<string,LL> MSI;
typedef map<LL,LL> MII;
///Print
#define casep(no,val) printf("Case %lld: %lld\n",++no,v... | C++ | 19564d66e0de78780f4a61c69f2c8e27 | aafd359b9a9738f34dfaa4ab45de7dad | 2,200 | PASSED |
// Sajal Asati
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mkp make_pair
#define pf push_front
#define ff first
#define ss second
// #define endl "\n"
#define lpstl(i,v) for(auto &i: v)
#define all(a) a.begin(),a.end()
#define rall(x) (x).rbeg... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 8855262c24c98bea9567be7d5e94784d | 2,100 | PASSED |
// Sajal Asati
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mkp make_pair
#define pf push_front
#define ff first
#define ss second
// #define endl "\n"
#define lpstl(i,v) for(auto &i: v)
#define all(a) a.begin(),a.end()
#define rall(x) (x).rbeg... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 02f01690e563006530e0af542454a788 | 2,100 | PASSED |
// Sajal Asati
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mkp make_pair
#define pf push_front
#define ff first
#define ss second
// #define endl "\n"
#define lpstl(i,v) for(auto &i: v)
#define all(a) a.begin(),a.end()
#define rall(x) (x).rbeg... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 116ecbe4b0849123f9795857e19f992b | 2,100 | PASSED |
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 226e429d49457722b484a8b8d4047833 | 2,100 | PASSED |
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 5d77004363ae34874887f0ff15371b18 | 2,100 | PASSED |
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | aa0584931fada3d6a39d3d50048e946d | 2,100 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000 + 10;
const int MOD = (int)(1e9) + 7;
vector<int> adj[MAXN];
int a[MAXN], f[MAXN];
bool visited[MAXN];
int d, n;
void DFS(int u, int root) {
visited[u] = true;
f[u] = 1;
for(int i = 0; i < adj[u].size(); i++) {
int v = adj[u][i]... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 139b2db0c9b7875c115df08c9c1365db | 2,100 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=6e3+20;
const ll mod=1e9+7;
vector<int> e[N];
ll d,n,a[N];
ll sz[N],ans,mk[N];
void dfs(int u,int fa,ll mn)
{
if(a[u]<mn||a[u]>mn+d)
return;
if(mk[u]&&a[u]==mn)
return;
if(fa==0)
mk[u]=1;
sz[u]=1ll;
for(int i=0;i<e[u].size();i++)... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 5683f02ef439b0b2e8c054572abcfe13 | 2,100 | PASSED |
/*
NO
TIME
TO
DIE
--007
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <boost/functional/hash.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef lon... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | 2f62da622f3ef9063b8035f49e9a4480 | 2,100 | PASSED |
/*
If u can prepare to learn and adapt
you can transform*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <boost/functional/hash.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
... | C++ | 88bb9b993ba8aacd6a7cf137415ef7dd | aeb42be818d13f37b13a6c310e0c6edc | 2,100 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
char s[N];
int pre[N], add[N], cnt[200], m, len, lf[N][26];
bool vis[N];
/*
bool greedy(int c) {
memset(vis, 0, sizeof(vis));
int cc = 0;
for(int i = m; i <= len; i++) if(pre[i] == pre[i-m]) {
if(lf[i][c] > i-m) {
... | C++ | 2924053ee058c531254d690f0b12d324 | 8d2729639716f35a22687c2b2f633f4d | 1,900 | PASSED |
/*
The race is not to the swift,
nor the battle to the strong,
but time and chance happens to them all .
-Munich
*/
#include <bits/stdc++.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <ctime>
#include <stdio.h>
#include <ctype.h>
#inc... | C++ | 2924053ee058c531254d690f0b12d324 | f6e68553b264ee3b31f97a024c53b377 | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int m;
scanf("%d",&m);
char s[100006];
scanf("%s",s);
map<char,int>has;
set< pair<char,int> >h;
for(int i=0;i<m;i++)
{
has[s[i]]=i;
}
map<char,int>:: iterator it;
it=has.begin();
char ans[100005];
vector< pair<char,int> >b;
int prev=it->second;
... | C++ | 2924053ee058c531254d690f0b12d324 | 10c61a87e525961b87e1fe5f7b067e6a | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( g... | C++ | 2924053ee058c531254d690f0b12d324 | 0970fa4c2df36c0ee4b2f8f15d8b92f9 | 1,900 | PASSED |
#include<bits/stdc++.h>
#define M 100005
using namespace std;
string str,buf;
bool judge(int ans,int m){
int cnt=0,sz=str.size();
int L=0,R=m-1;
for(int i=L;i<=R;i++)cnt+=(str[i]<=ans+'a');
if(!cnt)return 0;
while(R+1<sz){
++R;
cnt-=(str[L]<=ans+'a');
cnt+=(str[R]<=ans+'a');
++L;
if(!cnt)return 0;
}
re... | C++ | 2924053ee058c531254d690f0b12d324 | be80a3963bba2b179f50e425629c4e62 | 1,900 | PASSED |
#include<cstdio>
#include<set>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 100010;
int n, m, ans[26];
char s1[N];
bool yes[N];
vector<int>have[26];
typedef pair<int,int> pii;
set<int> s;
set<int> ::iterator it;
int main() {
scanf("%d... | C++ | 2924053ee058c531254d690f0b12d324 | 2a0b87df9f86b3143e106d12708a7c72 | 1,900 | PASSED |
#include<cstdio>
#include<set>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 100010;
int n, m, ans[26];
char s1[N];
bool yes[N];
vector<int>have[26];
typedef pair<int,int> pii;
set<int> s;
set<int> ::iterator it;
int main() {
scanf("%d... | C++ | 2924053ee058c531254d690f0b12d324 | e780592b79b984b8de248e492eef4dc5 | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ite iterator
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define ioS ios::sync_with_stdio(false);
#define mod 1000000007
int main()
{
ioS;
ll i,j,k,l,r,m,n,o,t;
{
char str[100001];
bool mark[100000]={0};
ll... | C++ | 2924053ee058c531254d690f0b12d324 | 3971fcd5dac006246e349d4d29232276 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pci pair<char,int>
#define mp(a,b) make_pair(a,b)
#define MAXN 100005
//pci t[4*MAXN];
string s;
int n,m;
string ans;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>m;
cin>>s;
n=s.size();
if(m==1)
{
sort(s.begin(),s.end());
cout<<s<<... | C++ | 2924053ee058c531254d690f0b12d324 | 220a3acf4add5227b05fa454243d406f | 1,900 | PASSED |
#include <cstdio>
#include <algorithm>
#include <set>
#include <utility>
static const int MAXN = 100005;
int n = 0, m, ans_len = 0;
char s[MAXN], ans[MAXN] = { '\0' };
std::pair<char, int> p[MAXN];
std::set<int> marked;
std::multiset<int> distance;
int main()
{
scanf("%d", &m); getchar();
while ((s[n] = getch... | C++ | 2924053ee058c531254d690f0b12d324 | f94a549bc72ee6fc3d552ca7caf50c9f | 1,900 | PASSED |
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int girls[101],boys[101];
const int N=1E6+1;
int freq[N];
vector<string>vc,vc2;
int main() {
int n;
cin >> n;
string s;
cin >> s;
string reham=s;
while (true) {
for (int j = 0; j < s.size(); j++) {
int x = s[... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 01c2aae5a39443f230c5a6c579beb361 | 1,500 | PASSED |
#include <bits/stdc++.h>
#include <string>
using namespace::std;
#define ll long long int
#define mp make_pair
#define ff first
#define ss second
const int MOD=1000000007,INF = 1e9,MAX = 2e6;
ll a[MAX],b[MAX],C[MAX];
vector < ll > v;
char ans[10000] ;
ll l ;
bool is_smaller(char s[])
{
ll i,j,k;
for(i=0... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 395ce18716ec546ff77b19f29fa4d660 | 1,500 | PASSED |
#include <cstring>
#include <cstdio>
int n;
char s1[1010],s2[1010],ans[1010];
void solve(){
int las=10-(s2[0]-'0');
s2[0]='0';
for(int i=1;i<n;i++) s2[i]=(s2[i]-'0'+las)%10+'0';
if(strcmp(s2,ans)<0) strcpy(ans,s2);
}
int main(){
scanf("%d%s",&n,s1);
for(int i=0;i<n;i++) ans[i]='a';... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | ee51af7660cb312bfb932ed7cb582141 | 1,500 | PASSED |
#define INF 1 << 30
#include<algorithm>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<utility>
using namespace std;
int less1(vector<int>& a, vector<int>& b);
void shift(vector<int>& orig, vector<int>& dest);
void add1(vector<int>& orig, vector<int>& dest);
void printvet(vector<int>... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 51fc0d05421718a817dd848847321bae | 1,500 | PASSED |
/*
CODED BY : Super_KAZAKH(-: >----> Yedige Ashirbek
_____ _____ _______________ ___ _______ ________________ _______________
/\ \ /\ \ /\ \ /\ \ /\ \ / \ /\ \
\ \ \ \ \ ... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 3fd3e2ffbb9b7dd43b2c87db2fd6cb55 | 1,500 | PASSED |
/// Mirbek Bakirov
# include <algorithm>
# include <iostream>
# include <string.h>
# include <stdio.h>
# include <iomanip>
# include <math.h>
# include <vector>
# include <deque>
# include <deque>
# include <stack>
# include <queue>
# include <set>
# include <map>
# define pb push_back
# define fr first
# define mk ... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 755c08f1f76123250a535630cff79672 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define ALL(x) x.begin(),x.end()
#define M(a,x) memset(a,x,sizeof(a))
#define sci(x) scanf("%d",&x);
#define scl(x) s... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 5997fb476f33c74847720f9ad1cbe250 | 1,500 | PASSED |
#include <iostream>
#include <algorithm>
#define ll long long
#define f(n) for(int i = 0 ; i < n ; i++)
char check(char x){
x++;
if(isdigit(x)){
return x;
}
else{
return '0';
}
}
using namespace std;
int main()
{
int n;
string s, answer;
cin >> n >> s;
answer = s;... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 5c3390217dd5d05605341d18684c1d03 | 1,500 | PASSED |
#include <iostream>
#include <algorithm>
#define ll long long
#define f(n) for(int i = 0 ; i < n ; i++)
char check(char x){
x++;
if(isdigit(x)){
return x;
}
else{
return '0';
}
}
using namespace std;
int main()
{
int n;
string s, answer;
cin >> n >> s;
answer = s;... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | 2571397b9a8528ac36c04e31f1309aa3 | 1,500 | PASSED |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int n;
string right_shift(string s,int d)
{
return s.substr(s.size()-d,d)+s.substr(0,s.size()-d);
}
bool compare(string a,string b)//returns 1 if a is less than b
{
for(int i=0;i<n;i++)
{
if(a[i]==b[i])
continue;
... | C++ | 6ee356f2b3a4bb88087ed76b251afec2 | d0fb34ffc313236edf3c084762062eae | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
struct node{
int to,next;
}e[1000020];
int cnt,head[1000020],num[1000020];
void add(int u,int v){
++cnt; e[cnt].to=v;
e[cnt].next=head[u];
head[u]=cnt;
}
void solve(int u,int fa){
int cx[10];memset(cx,0,sizeof(cx));
int sum=0;
for(int i=head[u];i;... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | 96f50c2d6241370379b3687d71db348c | 2,300 | PASSED |
#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define cross(i,k) for (register int i=first[k];i;i=last[i])
using namespace std;
typedef long long ll;
inline ll read(){
ll x=0;int ch=getchar(),f=1;
while (!isdigit(ch)&&(ch!='... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | d577f8809f3330849bdd7197290fd4ce | 2,300 | PASSED |
#include<bits/stdc++.h>
const int maxn=1e5+15;
using namespace std;
vector<int> g[maxn];
int n,leg[maxn];
bool mark[maxn];
void init(){
scanf("%d",&n);
for (int u,v,i=1;i<n;++i){
scanf("%d%d",&u,&v);
g[u].push_back(v);
g[v].push_back(u);
}
}
void dfs(int u,int f){
if (g[u].size()... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | 8e43e1ce0b964e205df9a7d6efacedd7 | 2,300 | PASSED |
#include<bits/stdc++.h>
#define mk make_pair
#define fi first
#define nd second
#define sqr(x) ((x)*(x))
using namespace std;
typedef long long ll;
inline ll read() {ll x = 0; char ch = getchar(), w = 1;while(ch < '0' || ch > '9') {if(ch == '-') w = -1;
ch = getchar();}while(ch >= '0' && ch <= '9') {x = x * 10 + ch - '... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | da515307a29aa19ae8c25da2df241d9a | 2,300 | PASSED |
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert>
using namespace std;
const int maxn = 100100;
int n;
vector<int> adj[maxn];
int type[maxn]; //0: single branch, 1: double branch, 2: single side, 3: double side, 4: special case 0, 5: special case 1
vo... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | 8989c92fc259a684933bf9a550b868eb | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 100005;
bool del[maxn];
vector<int> e[maxn];
int res[maxn];
void dfs(int u, int fa = 0)
{
if(e[u].size() <= 2) {
del[u] = true;
for(int i = 0; i < e[u].size(); i++) if(fa != e[u][i]) dfs(e[u][i], u);
}
}
void work()
{
int n;... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | b9e73e6425798e253bedfd17df61700d | 2,300 | PASSED |
/* In the name of ALLAH */
#include <iostream>
#include <vector>
using namespace std;
const int N = 1e5+10;
vector< int > g[N];
int n;
bool deg[N];
bool Can(int v , int par){
int cnt=0;
bool ret=true;
for( auto u : g[v] )
if(u != par)
ret &= deg[u] , cnt ++;
if(!ret or cnt > 2) return false;
return true;... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | dadd69a3de45b40bbb7be6dbb2351da8 | 2,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n;
vector<int> g[maxn];
bool vis[maxn];
void cut(int u, int pa){
if(!vis[u] && g[u].size() <= 2){
vis[u] = true;
for(auto v : g[u]) cut(v, u);
}
}
int main(){
scanf("%d", &n);
for(int i = 1; i < n; i++){
int u, v; scanf("%d%d", &u... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | 665c24be026add17706ec45822182532 | 2,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> g[maxn];
// leg连接到叶子节点的简单路径(不分叉)
bool del[maxn]; // vertices in legs are marked as deleted
int legs[maxn]; // numbers of legs starting in a vertex
void dfs(int u, int pa) {
if(g[u].size() <= 2) {
del[u] = true;
for(int v : g[u])... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | 0848211e54d309cd5d26cf08bb6b4362 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define boost ios_base::sync_with_stdio(false)
#define pb push_back
#define e1 first
#define e2 second
#define tysiac 1010
#define milion 1000100
#define OUT(x) { cout << x; exit(0); }
typedef long long int ll;
typedef unsigned int ui;
typedef unsigned ... | C++ | 6aea921117003a03e6b6dc6f8d59f753 | ec2f3287dccc4aa0b39d0f5f83c91984 | 2,300 | PASSED |
#include <bits/stdc++.h>
#define ll long long
#define N 100005
#define pii pair<ll,int>
#define mp make_pair
using namespace std;
const int blo=320;
int n,a[N],id[N],bel[N],L[blo],R[blo];
ll tk[blo],tb[blo],f[N],ans;
inline double slope(int i,int j)
{
if(a[i]==a[j]) return f[i]>f[j]?-1e20:1e20;
else return (double)... | C++ | 78cdbd4869982e417aa7975dd7a9f608 | bbce251a642452a7503b15261487031e | 3,200 | PASSED |
#include<bits/stdc++.h>
const int N = 100100;
typedef long long ll;
std::mt19937 rd(time(0));
int ls[N],rs[N],sz[N],p[N],rt,n,tot;
ll v[N],ad[N],tg[N];
int nd(ll a){ return p[++tot]=rd(), sz[tot] = 1, v[tot] = a,tot; }
void up(int x){ sz[x] = sz[ls[x]] + sz[rs[x]] + 1; }
void pt1(int x,ll t){ if(x) v[x] += t, ad[x] += ... | C++ | 78cdbd4869982e417aa7975dd7a9f608 | e312f9daa77c8cee15c3e216f9b97643 | 3,200 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.