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 |
|---|---|---|---|---|---|
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class CodeForce{
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
while(t-->0){
String str=br... | Java | 5de66fbb594bb317654366fd2290c4d3 | f988d9a1d146b21754afcc6cac5be2c4 | 800 | PASSED |
import java.io.*;
import java.util.*;
public class Solution{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i1=0;i1<t;i1++)
{
String s=sc.next();
char[] ch=s.toCharArray();
int x=s.indexO... | Java | 5de66fbb594bb317654366fd2290c4d3 | ce821769177df0368f8d567c27aba036 | 800 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import ... | Java | 5de66fbb594bb317654366fd2290c4d3 | 0f201ba69d9aeb9ddc478aca35e2a3b4 | 800 | PASSED |
//package codeforce;
import java.util.*;
public class class5 {
public static void main(String []args){
Scanner scan= new Scanner(System.in);
int test;
String s;
test=scan.nextInt();
while(test-- >0){
int count=0;
s=scan.next();
int f=s.indexOf('1');
int l=s.lastIndexOf('1'... | Java | 5de66fbb594bb317654366fd2290c4d3 | 708b777b307cf60b737e385da338578b | 800 | PASSED |
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class cf1185e {
public static void main(String[] args) throws IOException {
int t = ri();
next: while (t --> 0) {
int n = rni(), m = ni(), pos[][] = new int[26][4], bounds[][... | Java | f34d21b9568c758cacc1d00af1316c86 | 010120ece23c88b5f94dc3c5967eb5c8 | 2,000 | PASSED |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2010;
char c[maxn][maxn];
int T;
int n,m;
int tu[maxn][maxn];
int temp[maxn][maxn];
struct node{
int x1,y1,x2,y2,f,dir;
}pos[30];
int main()
{
scanf("%d",&T);
while(T--){
memset(pos,0,sizeof(pos));
scanf("%d%d"... | C++ | f34d21b9568c758cacc1d00af1316c86 | d15c8ee8e3cf49fa1b6b4aa21d4f1a0b | 2,000 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <set>
#include <iterator>
using namespace std;
using namespace __gnu_pbds;
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()
#define ll long long int
#defin... | C++ | f34d21b9568c758cacc1d00af1316c86 | 5b12c29538a07b30904d1fa6fbba0830 | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m, active[300];
string s[2003];
char M[2002][2002];
pair <int, int> max_cord[300], min_cord[300];
void solve(){
for (int i = 0; i < 130; i ++)
max_cord[i] = {-1000000000, -1000000000},
min_cord[i] = { 1000000000, 1000000000},
activ... | C++ | f34d21b9568c758cacc1d00af1316c86 | e6a995161a54ed5e4ad1e7e2ce049a1a | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int tt;
cin >> tt;
int n, m;
while (tt--) {
cin >> n >> m;
vector<string> A(n);
for (int i = 0; i < n; i++) {
cin >> A[i];
}
vector<vector<pair<int, int>>> P(26);
for (int i = 0; i ... | C++ | f34d21b9568c758cacc1d00af1316c86 | 074ebb2dba2e5f8493a3e794c25dc2d5 | 2,000 | PASSED |
#pragma GCC optimize("O3")
#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;
typedef long long ll;
typedef pair<int, int> pi;
tree<int,int,greater<int>,rb_tree_tag,tree_order_statistics_node_update> map_t;
#defin... | C++ | f34d21b9568c758cacc1d00af1316c86 | e129b743890e3d57cecaae917aeead6d | 2,000 | PASSED |
#include<algorithm>
#include <iostream>
using namespace std;
int main() {
int n,m , a[51] ,b[51];
cin>>n;
for(int i=0 ;i<n ;i++){
cin>>a[i];
}
cin>>m;
for(int i=0 ;i<m ;i++){
cin>>b[i];
}
int num[100]={0};
int l=0;
for(int i=0 ;i<m ;i++){
f... | C++ | 102667eaa3aee012fef70f4192464674 | c9853d70e24ff580123045e7ff3df2a9 | 900 | PASSED |
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int a[55],b[55],vis[10010];
int main()
{
int n,m,maxx=-1;
memset(vis,0,sizeof(vis));
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
scanf("%d",&m);
for(int i=1;i<=m;i++)
scanf("%d",&b[i]);
f... | C++ | 102667eaa3aee012fef70f4192464674 | 236df9f4083451df845b5efeb37005c7 | 900 | PASSED |
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int N,M,i,j,k,a[100],b;
vector<int> V;
while(scanf("%d",&N) == 1)
{
for(i=0;i<N;i++)
{
scanf("%d",&a[i]);
}
scanf("%d",&M);
for(i=0;i<M;i++)
{
... | C++ | 102667eaa3aee012fef70f4192464674 | 3f788808a57f097c47a482b8a2965c6a | 900 | PASSED |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int n,m,i,j,s1[55],s2[55],k=-1,s=0,g[55]={0};
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&s1[i]);
scanf("%d",&m);
for(i=0;i<m;i++)
scanf("%d",&s2[i]);
for(i=m-1;i>=0;i--)
{
for... | C++ | 102667eaa3aee012fef70f4192464674 | fc00fcfa083afd052466da0584b758ca | 900 | PASSED |
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <cctype>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<in... | C++ | 102667eaa3aee012fef70f4192464674 | 2ce7e9567063bce55820a80aa9570203 | 900 | PASSED |
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <cctype>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<in... | C++ | 102667eaa3aee012fef70f4192464674 | 56de6837fbf7fe883268d62b038086d5 | 900 | PASSED |
#include <iostream>
using namespace std;
const int MAX_N = 50 + 5;
int a[MAX_N], b[MAX_N];
int main()
{
int n, m;
cin >> n;
for(int i = 0; i < n; i++)
cin >> a[i];
cin >> m;
for(int i = 0; i < m; i++)
cin >> b[i];
int _max = -1, now;
for(int i = 0; i < n; i++)
{
... | C++ | 102667eaa3aee012fef70f4192464674 | 7d663f9d8361908acc67fb8e82e515bb | 900 | PASSED |
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <string>
#define LL long long
#define eps 1e-7
using namespace std;
int n,m,a[101],b[101];
int main()
{
//freopen("in.txt","r",stdin);
while(scanf("%d",&n)!=EOF)
{
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
scanf("%d",&m... | C++ | 102667eaa3aee012fef70f4192464674 | baee63a028616d7a83e4aadded13ed7d | 900 | PASSED |
/*
ID:litiany3
PROG:race3
LANG:C++
*/
/*
SBT
节点 保存已删除的节点。
*/
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <bitset>
using namespace std;
#define sqr(x) ((x)*(x))
#defi... | C++ | 102667eaa3aee012fef70f4192464674 | 2193ba843ac079d8c39a91022df0c204 | 900 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int ar[55],br[55];
int cnt[10005];
int main(){
int n,m;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&ar[i]);
scanf("%d",&m);
for(int j=1;j<=m;j++) scanf("%d",&br[j]);
int maks=0;
memset(cnt,0,sizeof cnt);
fo... | C++ | 102667eaa3aee012fef70f4192464674 | 6377b1592cddf424c829de777f58a708 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll n; cin>>n;
ll a[6000]={0};
for(ll i=1;i<=n;i++)
{
ll x;
cin>>x;
a[i]=x;
}
ll ans=0;
for(ll i=1;i<=n;i++)
if(i==a[a[a[i]]] && a[i]!=a[a[i]])
ans+... | C++ | a37c3f2828490c70301b5b5deeee0f88 | 38964a6f37589dac5c1e723cb054781b | 800 | PASSED |
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int f[n];
bool love=false;
for(int i=0;i<n;i++)
{
cin>>f[i];
}
for(int i=0;i<n;i++)
{
if(f[i]>=1 && f[i]<=n)
{
if(f[f[i]-1]>=1 && f[f[i]-1]<=n)
{
... | C++ | a37c3f2828490c70301b5b5deeee0f88 | ea9c72ed21805fd99ec3196bbb39553b | 800 | PASSED |
//g++ 5.4.0
#include <iostream>
using namespace std;
int main()
{
int n,i ,x,y,z;
int love[100005];
cin>>n;
for(i=1;i<n+1;i++)
cin>>love[i];
for(i=1;i<n+1;i++)
{
x=love[i];
y=love[x];
z=love[y];
if(z==i)
{
cout<<"YES";
break;
}
else if(i==... | C++ | a37c3f2828490c70301b5b5deeee0f88 | 3608ced29f520babdd538344fbf91ba1 | 800 | PASSED |
#include <iostream>
using namespace std;
int main() {
int n, a[10000], i, j;
bool tri;
tri = false;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> a[i];
}
for (i = 1; i <= n; i++) {
if (i == a[a[a[i]]]) {
tri = true;
break;
}
}
cout << (tri ? "YES" : "NO") << endl;
return 0;
}
| C++ | a37c3f2828490c70301b5b5deeee0f88 | 78746654930db1ed913577575c135346 | 800 | PASSED |
#include<iostream>
using namespace std;
int main(){
int n;
bool triangle=0;
cin>>n;
int x[n];
for(int i=0; i<n; i++)cin>>x[i];
for(int i=0; i<n; i++){
if(i+1!=x[i] && x[x[i]-1]!=x[i] && x[x[x[i]-1]-1]==i+1 ){
triangle=1;
break;
}
}
if(triangle)cout<<"YES";
else cout<<"NO";
return 0;
}
| C++ | a37c3f2828490c70301b5b5deeee0f88 | 8f3bb294e71c9bb84429d260aa7dc712 | 800 | PASSED |
#include <stdio.h>
int f[5010];
int main()
{
int n; scanf("%d", &n);
for(int i = 1; i <= n; i ++) scanf("%d", &f[i]);
for(int i = 1; i <= n; i ++)
{
if(f[f[f[i]]] == i)
{
printf("YES\n");
return 0;
}
}
printf("NO\n");
return 0;
} | C++ | a37c3f2828490c70301b5b5deeee0f88 | aaed7dfd94f2482d979463950bc62ce6 | 800 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void)
{
int n,i,f[5000],s,k1,k2,j;
scanf("%d",&n);
for (i=0;i<n;i++){
scanf("%d",&f[i]);
f[i]--;
}
s=0;
for (i=0;i<n;i++){
k1=f[i];
k2=f[k1];
if (f[k2]==i){
s=1;
break;
}
... | C++ | a37c3f2828490c70301b5b5deeee0f88 | 894c852a0c7c4cf550ff1cd62a5ed1f8 | 800 | PASSED |
#include<iostream>
using namespace std;
bool method(int i, int num[])
{
if (i + 1 == num[num[num[i] - 1]-1] && i + 1 != num[i])
return true;
return false;
}
int main()
{
int n;
cin >> n;
int num[5000];
for (int i = 0; i < n; i++)
{
cin >> num[i];
}
for (int i = 0; i < n - 2; i++)
{
if (method(i, num))
... | C++ | a37c3f2828490c70301b5b5deeee0f88 | 69c50de10610a01e64954ab2f04dea8e | 800 | PASSED |
#include<cstdio>
#include<cstdio>
int n,i,j,e=0,a[100001];
int main() {
scanf("%d",&n);
for(i=1; i<=n; i++)
scanf("%d",&a[i]);
for(i=1; i<=n; i++) {
for(j=i+1; j<=n; j++)
if(a[i]==j&&a[a[j]]==i) {
printf("YES");
e=1;
break;
}
if(e==1) break;
}
if(e==0) printf("NO");
return 0;
}
| C++ | a37c3f2828490c70301b5b5deeee0f88 | 8056d40c091aefd263b5d731ae105bc4 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a[5005];
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
for(int i=1;i<n;i++)
{
if(a[a[a[i]]]==i)
{
printf("YES\n");
return 0;
}
}
printf("NO\n");
} | C++ | a37c3f2828490c70301b5b5deeee0f88 | d73b7b30693da346994a32599732af8a | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define li long long int
#define rep(i,n) for(li i=0;i<n;i++)
const double pi=3.141592653589793238;
void prime(li n)
{
vector<pair<int,int>>f;
for(li i=2;i*i<=n;i++)
{
if(n%i==0 && n>0)
{
cout<<"YES";
... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 8212a86c121f0afa41d2a813d00c1728 | 1,300 | PASSED |
//https://codeforces.com/contest/1238/problem/B
#include <bits/stdc++.h>
// #include "stdafx.h"
// #pragma warning(disable : 4996) //_CRT_SECURE_NO_WARNINGS
using namespace std;
#define gc getchar_unlocked
# define foreach(x, v) for (typeof (v).begin() x = (v).begin(); x != (v).end(); ++x)
# define For(i, a, b) for... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 006e809e95bbcf18a212a913b91a2bc1 | 1,300 | PASSED |
#include <iostream>
#include <cmath>
#include <windows.h>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
#define forn(i,n) for(int i=0;i<(... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | dc3642fcbc4342248eb095c971eb07ec | 1,300 | PASSED |
#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | a461634e387a070717a696e18a7d0a5f | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 9;
int pos[sz];
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int n,r;
cin>>n>>r;
int A[n];
for(int i = 0 ;i<n ;i++)
cin>>A[i];
int p = 0,fire = 0;
sort(A,A+n,... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | ba4177e0dec2aa6eac567e223e29803b | 1,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define f first
#define s second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
void solve(int n, int r) {
int a[n], i;
for (i = 0; i < n; i++) {
//c... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 25f89787055833656c33ab9f2d191554 | 1,300 | PASSED |
/* CREATED BY
STREAM_CIPHER
02-02-2020
//
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int t;
... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 26b5eefb7084546d6129d618ed4d984e | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
std::ios::sync_with_stdio(false);
int q;
cin>>q;
//sync_with_stdio(false);
while(q--)
{
map<int, int> cnt;
int n,r;
cin>>n>>r;
vector<int> a;
for(int i=0; i<n; i++)
{
... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 6f650d758205ad724233b25fd3e0f8bd | 1,300 | PASSED |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
ll q;
cin>>q;
while(q--)
{
ll n,x,i,p,cnt=0,j,c=0;
cin>>n>>x;
vector<ll> a;
for(i=0;i<n;i++)
{
cin>>p;
a.push_back(p);
}
sort(a.begin(),a.end());
a.resize(un... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 8d0f15612837dc2cf99feb6081e15e96 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
//*****************Data type**********************//
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
typedef unsigned long long int ulli;
//****************SET**************************//
typedef set<int> SI;
typedef set<string> SS;
typede... | C++ | 60b6c6f047051eeabfe4e3a9e045c6b0 | 4c3629a91aef92f90075b1edcf489143 | 1,300 | PASSED |
#include <iostream>
#include <cmath>
using namespace std;
unsigned int max_ID(long long int a[], long long int b[], unsigned int n)
{
unsigned int max_ID;
unsigned long long int max;
max_ID = 0;
max = pow(a[0] - b[0], 2);
for(unsigned int i = 1; i < n; i++){
if(pow(a[i] - b[i], 2) > max){
max_ID = i;
max... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 7185d9f3e6b5a7e97e2f08aa6b6f7065 | 1,500 | PASSED |
#include<stdio.h>
#include <string.h>
long long int a[1005],b[1005],c[1005];
void m(int n);
int main(void)
{
int n,k1,k2;
long long int t=0,ans=0,sum=0;
c[0]=0;
scanf("%d%d%d",&n,&k1,&k2);
for(int i=1;i<=n;i++)
scanf("%lld",&a[i]);
for(int i=1;i<=n;i++)
scanf("%lld",&b[i]);
for(int i=1;i<=n;i++)
if(a[i]>... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 69048d9f8c6ade44e03261903d6355ab | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define boost ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define pii pair<ll,ll>
#define forn(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define mset(arr,x) memset(arr,x,sizeof(... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | dda6b76028793d8f3b5baa83f7145d62 | 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 trace1(x) cerr<<#x<<": "<<x<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) ce... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 697e43c1a53df51c959ae08b5ca014ab | 1,500 | PASSED |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <time.h>
#define ll long long
#define mp(a,b) make_pair(a,b)
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define ss(s)... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 4ffc29f23d7e7348a962caef586fd914 | 1,500 | PASSED |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <time.h>
#define ll long long
#define mp(a,b) make_pair(a,b)
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define ss(s)... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 040c2f81716722a5df5d9be1e4aa6cc9 | 1,500 | PASSED |
#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#define fast ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define pf push_front
#define lli long long int
#define ll long long
#define inf 1000000000000000000
#define mp ... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 1eaa706e3c33d570d4e64ffb0d8adfa6 | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n, i, k, k1, b;
long long a[10005], pa;
int main()
{
cin>> n >> k >> k1;
k += k1;
for(i = 0 ; i < n ; i ++)
{
cin>> a[i];
}
for(i = 0 ; i < n ; i ++)
{
cin>> b;
a[i] -= b;
a[i] += (-2) * (a[i] < 0) * a[i];
}
while(k --)
{
sort(a, a + ... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 02dca31c324ba293e42486ae3093f1c8 | 1,500 | PASSED |
#include <iostream>
#include <algorithm>
using namespace std;
long long int n, k1, k2;
long long int a[1005];
long long int b[1005];
long long int r[1005];
int main () {
cin >> n >> k1 >> k2;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
cin >> b[i];
... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | c4af4fb8462772417e399d7bcc2be3e7 | 1,500 | PASSED |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long lon... | C++ | 88d54818fd8bab2f5d0bd8d95ec860db | 022f9c118dd77c5c49c5647bffffeb97 | 1,500 | PASSED |
// July 26, 2019
// https://codeforces.com/contest/1197/problem/D
/*
1LL * k * (i + m - 1) / m != 1LL * (i + m - 1) / m * k.
Also, how's this convention: when the variables in the problem statement are
capitals (e.g. N), use MAXN. But when they're lowercase, just use the uppercase
letter to denote the max value, such... | C++ | 529aed80a647d181f08d2c26bb14d65d | b877a00d4ed40102cdf8feb0d01f4af2 | 1,900 | PASSED |
#include <cstdio>
#include <algorithm>
using namespace std ;
const int N = 3e5 + 5 ;
typedef long long ll ;
ll num[N] ;
int main(){
int n , m , k ;
scanf ("%d%d%d",&n,&m,&k) ;
for (int i = 1 ; i <= n ; ++ i)
scanf ("%lld",&num[i]) ;
ll ans = 0 ;
for (int j = 0 ; j < m ; ++ j){
ll now = 0 ;
for (int i... | C++ | 529aed80a647d181f08d2c26bb14d65d | 8132c41d2499e2406446ea3beab7f1fe | 1,900 | PASSED |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
#define ll long long
#define P pair<int,int>
#define PII pair<pair<int,int>,int>
#define fi first
#define se second
#define inf 0x3f3f3f
#define INF 0x3f3f3f3f
#define test(n) cout<<n<<endl
#define mst(a,b) memset(a,b,sizeof(... | C++ | 529aed80a647d181f08d2c26bb14d65d | aa26a0d21f4d9e9bfe190593786805d4 | 1,900 | PASSED |
#include <bits/stdc++.h>
#define USE_CIN
using namespace std;
#define int64_t long long
#ifdef PREPROD
#define dprintf(...)printf("[%d:%s] ",__LINE__,#__VA_ARGS__),printf(__VA_ARGS__)
#else
#define dprintf(...)42
#endif
constexpr int64_t MOD=1e9+7;
constexpr int64_t INF=1e12;
namespace SOLVE{int NONE;
int64_t a[300100]... | C++ | 529aed80a647d181f08d2c26bb14d65d | 2ad3c13de40fb092c20d15481269ce92 | 1,900 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 3e5 + 10;
int a[N], b[N], n, m, k;
signed main(void)
{
ios::sync_with_stdio(false), cin.tie(0);
cin >> n >> m >> k;
for (int i = 1; i <= n; ++i) cin >> a[i];
int ans = 0;
for (int i = 0; i < m; ++i){
int sum... | C++ | 529aed80a647d181f08d2c26bb14d65d | aa53432423d9f7ccb65d033ab195b37c | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#include <algorithm>
#include <iterator>
using ll = long long;
const int maxn = 3e5 +5 ;
ll dp[maxn][12];
int main() {
// freopen("in.txt","r",stdin);
int n, m ,k ; cin >> n >> m >> k;
ll a[n];
ll res = 0;
for (int i = 0; i < n; ++i) {
cin>>a[i];
}... | C++ | 529aed80a647d181f08d2c26bb14d65d | 140856f5d5f886bb5d0885695ce98528 | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
long long d[300005][20],a[300005],n,m,k,res=0;
int main(){
cin>>n>>m>>k;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=m;i++) d[0][i]=-1e10;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(j==1) d[i][j]=max(a[i]-k,d[i-1][m]+a[i]-k);
... | C++ | 529aed80a647d181f08d2c26bb14d65d | ab3f8555d541c056af1f16090b4cc143 | 1,900 | PASSED |
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <fstream>
#include <math.h>
#include <queue>
#include <bitset>
#include <cmath>
#include <complex>
#include <iomanip>
#include <valarray>
#include <stack>
#include <cstring>
using namespace std;
typedef vector<int> vi;
ty... | C++ | 529aed80a647d181f08d2c26bb14d65d | fd48b6b57b11d176eca78c26e5d4102e | 1,900 | PASSED |
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <fstream>
#include <math.h>
#include <queue>
#include <bitset>
#include <cmath>
#include <complex>
#include <iomanip>
#include <valarray>
#include <stack>
#include <cstring>
using namespace std;
typedef vector<int> vi;
ty... | C++ | 529aed80a647d181f08d2c26bb14d65d | b778b42e63d1d001b0b82bc081a8ec88 | 1,900 | PASSED |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define ll long long
using namespace std;
inline long long read(){
long long x=0,pos=1;char ch=getchar();
for(;!isdigit(ch);ch=getchar()) if(ch=='-') pos=0;
for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
r... | C++ | 529aed80a647d181f08d2c26bb14d65d | e135b53c8c9dafbaab3bb166029cc530 | 1,900 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
int a[300010][2];
int main()
{
int n,i,j,k,m;
int x,y,x1,y1,x2,y2,x3,y3;
cin >> n;
cin >> a[0][0] >> a[0][1];
x=a[0][0];
y=a[0][1];
x1=y1=x3=y3=0;
for(i=1;i<n;i++)
{
cin >> a[i][0] >> a[i][1];
if(a[i][0]>x)
... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 1260d72295b53176738881a9630c0c8b | 1,600 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n, l, r, ans, a[300050], b[300050], g1 = -1, g2 = -1;
int main (void) {
ios::sync_with_stdio (false);
cin >> n;
cin >> a[1] >> b[1];
l = a[1];
r = b[1];
for (int i = 2; i <= n; ++ i) {
cin >> a[i] >> b[i];
l... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 2a57179b0682607371a7149ef7c79edb | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std ;
#define LL long long
LL read(){
char c ;
int sign = 1 ;
while((c = getchar()) > '9' || c < '0')
if(c == '-') sign = -1 ;
LL ans = c - '0' ;
while((c = getchar()) <='9' && c >= '0')
ans = ans * 10 + c - '0' ;
return ans * sign ;
}
i... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | b5627f2e42fbb3e9ac54ed02d16e70ce | 1,600 | PASSED |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define MAXN 500010
using namespace std;
struct Edge{int l,r,id;}edge[MAXN];
Edge l1,l2,r1,r2;
int n,ans;
int main()
{
scanf("%d",&n);
r1.r=2147483647;
r2.r=2147483647;
for(int i=1;i<=n;i++)
{
scanf("%d%d",&edge[i].l,&edge[i].r);
if(edge... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 67585824eec7d8bddde55b23a84eacab | 1,600 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define ll long long
#define MAX 300300
inline int read()
{
int x=0;bool t=false;char ch=getchar();
while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
if(ch=='-')t=true,ch=getc... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 595a57e3cebc9b401cfdab3a1b615433 | 1,600 | PASSED |
#include<bits/stdc++.h>
#define N 300005
using namespace std;
int n,a[N],l[N],r[N];
int li[N],rm[N];
int il[N],mr[N];
int ans;
int main()
{
scanf("%d",&n);int al,ar;
for(int i=1;i<=n;++i) scanf("%d%d",&l[i],&r[i]);
li[0]=0;rm[0]=1000000000;
il[n+1]=0,mr[n+1]=1000000000;
for(int i=1;i<=n;++i) li[i]=max(l[i],li[i-1]... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | ac2fdcc337a193f8f4fd49d78e57bc50 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
multiset<int>a,b;
int l[300010],r[300010];
int main()
{
int n;
int ans=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>l[i]>>r[i];
a.insert(l[i]);
b.insert(r[i]);
}
for(int i=0;i<n;i++)
{
a.erase(a.find(l[i]));
b.erase(b.find(r[i]));
ans = max(ans... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 587cc806560be462ea119b79ab861bdb | 1,600 | PASSED |
#include<iostream>
#include<cstdio>
using namespace std;
#define Max(_A,_B) (_A>_B?_A:_B)
#define Min(_A,_B) (_A<_B?_A:_B)
int n,l[300005],r[300005],al[300005],ar[300005],bl[300005],br[300005],ll[300005],rr[300005];
void init(){
scanf("%d",&n);
for(int i=1;i<=n;++i){
scanf("%d%d",&l[i],&r[i]);
}
... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 25515cf2b950cc1dc6cb1d6e71cc9a11 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6;
const ll INF=1e14;
struct Node{
ll L,R; int id;
}a[maxn];
Node b[maxn];
int n;
bool cmp1(Node a,Node b){ return a.L>b.L; }
bool cmp2(Node a,Node b){ return a.R<b.R; }
ll cal(){
sort(a+1,a+1+n,cmp1);
sort(b+1,b+1+n,cmp2);
ll ql... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | 1647eecc5032bd594323c670c46b174b | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6;
const ll INF=1e14;
struct Node{
ll L,R; int id;
}a[maxn];
Node b[maxn];
int n;
bool cmp1(Node a,Node b){ return a.L>b.L; }
bool cmp2(Node a,Node b){ return a.R<b.R; }
ll cal(){
sort(a+1,a+1+n,cmp1);
sort(b+1,b+1+n,cmp2);
ll ql... | C++ | b50df0e6d91d538cd7db8dfdc7cd5266 | bfbbbb4f7f3966ce96a662b35ea302a1 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin (),(x).end()
#define sqrt(x) sqrt(abs(x))
#define re return
#define sz(x) ((int)(x).size ())
#define prev PREV
#define next NEXT
using ll = long long;
using ii = pair<in... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | a7047a1c63a0e7fe629ae8eb17a68a13 | 2,500 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define vi vector<int>
#define vll vector<ll>
#define sei set<int>
#define sell set<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | 6905cf0a4bc489102d6a590078ac37d6 | 2,500 | PASSED |
// Daniel Grzegorzewski
// while (clock()<=69*CLOCKS_PER_SEC)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#define MP make_pair
#define PB push_back
#... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | e0d8c0d599db93cfa51548c3f93d70ec | 2,500 | PASSED |
#ifdef ONPC
# define _GLIBCXX_DEBUG
#define deb(a) cerr << "yo " << #a << " = " << a << endl;
#else
#define deb(a)
#endif
#include <bits/stdc++.h>
#define endl "\n"
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef ... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | 0c27bfd4d4ec00ca67e504bd97d158f7 | 2,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define oo 1000000010
#define mod 1000000007
const int N = (1 << 18);
vector< int > g[N];
int n , m;
int prnt[N];
int best , mx , s , e , u , v , d;
vector< int > arr , ans;
void DFS(int node,int cost){
if(cost > mx){
best = node;
mx = cost;
}
for(int i = 0 ;i <... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | d3c42b30f0d1f79c8c9e8fdf512cc134 | 2,500 | PASSED |
// InterestingLSY
// 2659723130
// 《幽灵公主》是真的好看!
#ifdef intLSY
#include <intlsy/stdc++.h>
#else
#include <bits/stdc++.h>
#endif
#include <bits/c++0x_warning.h>
using namespace std;
#define il inline
#define elif else if
// Type
#define ld double
#define ll long long
#define ull unsigned ll
// Vector
#define vc vector
... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | b46138b51b424bce78802ced7cb75d93 | 2,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int n, sol;
vector <int> v[MAXN];
int dist[MAXN], par[MAXN], dp[MAXN];
void dfs (int x, int rod) {
par[x] = rod;
dist[x] = dist[rod] + 1;
for (auto sus : v[x]) {
if (sus != rod) dfs(sus, x);
}
}
int f (int x, int rod) {
... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | 7811e1cd421cb6bd4b66982a36045792 | 2,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[150000];
bool dfs2(int root, int u, int level) {
if (level == 1)
return (adj[u].size() == 1);
for (int v : adj[u])
if (v != root) {
if (!dfs2(u, v, level - 1))
return false;
}
return true;
}
... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | b3e4d87cc6af5b7567e232d65a123f56 | 2,500 | PASSED |
// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1 << 17;
int n, m;
vector<int> g[maxn];
pair<int, int> dfs(int v, int p = -1){
pair<int, int> ans(1, v);
for(auto u : g[v])
if(u != p){
auto back = df... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | c2bb1cd936e64f832cf4d3bbc55970c0 | 2,500 | PASSED |
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
void *wmem;
char memarr[96000000];
template<class T> inline void walloc1d(T **arr, int x, void **mem = &wmem){
static int skip[16] = {0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
(*mem) = (void*)( ((char*)(*mem)) + skip[((unsigned... | C++ | ce19cc45bbe24177155ce87dfe9d5c22 | f5080439671fb9caffdfe84f2b1de42f | 2,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
struct node{
node* left;
node* right;
int a, priority;
int val, val1;
node(int a, int priority, int val):
val(val),
val1(val),
a(a),
priority(priority),
left(0),
right(0){};
};
void upd(node* &v)
{
v -> val1 = v -> val;
if(!v -> left)
{
}
else
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | ba4a9868bad15328666b2e54c3e28aef | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | c3421ef9d327927e6987689ed7928027 | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 264454b18014d3609060bc34b46855dc | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 3bd058372c60cfa8eeb8b6104e2f68e1 | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 88c2eaa063494411587c7aba88fc6c4d | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 55dcb80d4d61330860c46e2ed9ebcd29 | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 135d180661e18f0f067f2b195a9ce1d3 | 2,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define x first
#define y second
int N, Q, cL;
char s[555555];
struct range
{
public:
int l[2], m[2], r[2];
bool z;
void set(bool v)
{
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 9072b17d06392a47b926485a886ec66a | 2,800 | PASSED |
#include <bits/stdc++.h>
#define N 500005
using namespace std;
struct Node
{
int len, ans, lz, rr, ll, rl, lr;
} tr[2][N << 2];
Node operator+(const Node& a, const Node& b)
{
Node s;
s.lz = 0;
s.len = a.len + b.len;
s.ans = max(a.ans, b.ans);
s.ans = max(s.ans, max(a.rl + b.ll, b.lr + a.rr));
... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | ca252452a9b8cbd3c995afc8219b7c1c | 2,800 | PASSED |
#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
using namespace std;
const int N = 2e6 + 12;
bool debag = false;
struct vertex {
int maxcnt, leftcnt, rightcnt, sz, leftsz, rightsz;
char typeleft, typeright;
vertex(char type = '<') {
maxcnt = leftcnt = rightcnt = sz... | C++ | 900dbd78fbe04d1d66da1b9db1e20c2a | 7aa1a6649210283b0b395b3d6e988e8f | 2,800 | PASSED |
#include<bits/stdc++.h>
#define ll long long
#define Max 1000000000
#define Min -1000000000
using namespace std ;
int parent[201] ;
bool langauge[201] ;
int find_set(int v)
{
if(v == parent[v])
return v ;
return parent[v] = find_set(parent[v]) ;
}
int main()
{
cin.sync_with_st... | C++ | e2836276aee2459979b232e5b29e6d57 | 2b3c667cf0fb3091bab4669eea3dbe47 | 1,400 | PASSED |
#include<bits/stdc++.h>
#define ll long long
#define Max 1000000000
#define Min -1000000000
using namespace std ;
int par[201] ;
int cnt[201];
int lan[201][201];
int find(int v)
{
if(v == par[v])
return v ;
return par[v] = find(par[v]) ;
}
bool add(int x, int y){
int xx = find(... | C++ | e2836276aee2459979b232e5b29e6d57 | 5f5ac5b5e4219a020816f9e5a963f6bf | 1,400 | PASSED |
#include<bits/stdc++.h>
#define ll long long
#define Max 1000000000
#define Min -1000000000
using namespace std ;
int parent[201] ;
bool langauge[201] ;
int Size[201] ;
int find_set(int v)
{
if(v == parent[v])
return v ;
return parent[v] = find_set(parent[v]) ;
}
void add(int a, int b... | C++ | e2836276aee2459979b232e5b29e6d57 | 361d88dae14315374d8bfdfcf09a98dc | 1,400 | PASSED |
// Learning Languages.cpp : main project file.
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int MAXN = 305;
vector <int> v[MAXN];
queue <int> q[MAXN];
bool mark[MAXN], mark2[MAXN];
;
int a, b, n, m, k , cnt=0,f=0;
void DFS(int s)
{
int r=0;
mark[s] = true;
for (int i = 0; ... | C++ | e2836276aee2459979b232e5b29e6d57 | b7b233ee1dbda94fbafbb1ba8d4cba3e | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int inf = (int) 1e9;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<vector<int>> person(m);
vector<vector<int>> lang(n);
bool ok = false;
for (int i = 0; i < n; i++) {
int k;
cin >> k;
... | C++ | e2836276aee2459979b232e5b29e6d57 | a656a77b7bdfc475850fd5924d648503 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
void dfs(vector<lli> adj[], lli v, lli color[])
{
color[v] = 1;
//cout << v << " ";
for(lli u : adj[v])
{
if(color[u] == 0)
dfs(adj, u, color);
}
color[v] = 2;
}
int main()
{
lli n;
cin >>... | C++ | e2836276aee2459979b232e5b29e6d57 | e69593388142d62dc779487b7c3282b3 | 1,400 | PASSED |
/*input
8 7
0
3 1 2 3
1 1
2 5 4
2 6 7
1 3
2 7 4
1 1
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
using namespace std;
typedef long long ll;
int c = 1000000007;
int parent[101];
int size[101];
void make_set(int v) {
parent[v] = v;
size[v] = 1;
}
int find_set(int... | C++ | e2836276aee2459979b232e5b29e6d57 | bf06e7a7a1fa810c533f9371d76ac72f | 1,400 | PASSED |
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
// Leetcode
//static const auto speedup =[]() {std::ios::sync_with_stdio(false); std::cin.tie(NULL); return 0;}();
//__builtin_popcount()... | C++ | e2836276aee2459979b232e5b29e6d57 | f123c47a987a42839b7256d6a56cf3ad | 1,400 | PASSED |
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
// Leetcode
//static const auto speedup =[]() {std::ios::sync_with_stdio(false); std::cin.tie(NULL); return 0;}();
//__builtin_popcount()... | C++ | e2836276aee2459979b232e5b29e6d57 | bb1277641cf118175a55d9455542f0cb | 1,400 | PASSED |
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
// Leetcode
//static const auto speedup =[]() {std::ios::sync_with_stdio(false); std::cin.tie(NULL); return 0;}();
//__builtin_popcount()... | C++ | e2836276aee2459979b232e5b29e6d57 | 803480991663f6e538437f22ba7f51ca | 1,400 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.