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>
using namespace std;
using ll = long long;
int MX = 2e9+0.5;
struct fen {
map<int, int> dt;
void add(ll x) {
while (x < MX) {
dt[x]++;
x = x|x+1;
}
}
int get(ll x) {
int acc = 0;
while(x >= 0) {
... | C++ | aa78a750cac45117f7b4313928c50f76 | 569017aaf047587b0312a82c4f805b2a | 1,700 | PASSED |
// Created by KHALED MOSHARRAF PARVEZ
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define whatis1(x) cout<<#x<<"="<<x<<'\n'
#define whatis2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define whatis3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<... | C++ | aa78a750cac45117f7b4313928c50f76 | abb02a011c040b78043d180ea353861b | 1,700 | PASSED |
// Created by KHALED MOSHARRAF PARVEZ
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define whatis1(x) cout<<#x<<"="<<x<<'\n'
#define whatis2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define whatis3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<... | C++ | aa78a750cac45117f7b4313928c50f76 | e5f9cf0e581f9f5ddf77c14bdb96ada2 | 1,700 | PASSED |
// Created by KHALED MOSHARRAF PARVEZ
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define whatis1(x) cout<<#x<<"="<<x<<'\n'
#define whatis2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define whatis3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<... | C++ | aa78a750cac45117f7b4313928c50f76 | 92e6c189589f6578bdbfd3d9f44c4dd5 | 1,700 | PASSED |
// Created by KHALED MOSHARRAF PARVEZ
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define whatis1(x) cout<<#x<<"="<<x<<'\n'
#define whatis2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define whatis3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<... | C++ | aa78a750cac45117f7b4313928c50f76 | 07e4e0a94e5572d0b353633d88e8a1cc | 1,700 | PASSED |
// Created by KHALED MOSHARRAF PARVEZ
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define whatis1(x) cout<<#x<<"="<<x<<'\n'
#define whatis2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define whatis3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<... | C++ | aa78a750cac45117f7b4313928c50f76 | e4b50773d525706b422f901702b6fc18 | 1,700 | PASSED |
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <time.h>
typedef long long ll;
#define mp make_pair
using namespace std;
const int MOD = 1e9 + 7;
struct item{
int key, fraq;
int cnt, amount;
item *l, *r;
item()
: l(NULL), r(NULL... | C++ | aa78a750cac45117f7b4313928c50f76 | f1704da7705747a4c625c1a5fe3b53af | 1,700 | PASSED |
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <time.h>
typedef long long ll;
#define mp make_pair
using namespace std;
const int MOD = 1e9 + 7;
struct item{
int key, fraq;
int cnt, amount;
item *l, *r;
item()
: l(NULL), r(NULL... | C++ | aa78a750cac45117f7b4313928c50f76 | 3652bc98b6a946d681c181cecdb8a4e5 | 1,700 | PASSED |
#pragma GCC target("abm,movbe,bmi,bmi2,lzcnt,popcnt")
#pragma GCC target("f16c,fma,avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("inline")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("stack-check=no")
#define NDEBUG 1
#include <immintrin.h>
#include <bit... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | c1de9c3b4c35866ecbe6591165bc0d38 | 2,200 | PASSED |
#pragma GCC target("abm,movbe,bmi,bmi2,lzcnt,popcnt")
#pragma GCC target("f16c,fma,avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("inline")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("stack-check=no")
#define NDEBUG 1
#include <immintrin.h>
#include <bit... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | 63b6a30c4df42b65e7610996d3a9669d | 2,200 | PASSED |
#pragma GCC target("abm,movbe,bmi,bmi2,lzcnt,popcnt")
#pragma GCC target("f16c,fma,avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("inline")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("stack-check=no")
#define NDEBUG 1
#include <immintrin.h>
#include <bit... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | d866188d9a007ba845d751da2dd30c86 | 2,200 | PASSED |
#pragma GCC target("movbe")
#pragma GCC target("bmi,bmi2,lzcnt,popcnt")
#pragma GCC target("avx,avx2,f16c,fma,sse3,ssse3,sse4.1,sse4.2")
#pragma GCC optimize("O3")
#pragma GCC optimize("inline")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("omit-frame-pointer")
#include <immintrin.h>
#include <bits/stdc++.... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | 9dd6d7935709215ee64bd35aa7faff27 | 2,200 | PASSED |
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
const int M=1e5+10;
const int mod=998244353;
int bp[M][200];
int bp2[M][200];
int dp[M];
ll sum[M];
int ile[M];
int g[M],sp[M];
int add(int a,int b){
if(b==mod){
if(a>=0) return a;
re... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | e957dd24cf5819dd3023152300e9d787 | 2,200 | PASSED |
#include<iostream>
using namespace std;
const int du=998244353;
int dp[51][100001];
int l[51];
int r[51];
int mob[100001];
inline void add(int &x,const int &y){
x+=y;
if (x>=du)x-=du;
}
inline void de(int &x,const int &y){
x-=y;
if (x<0)x+=du;
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0)... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | c9dd620804d989f1d54579a3dca8ecd8 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 1e5 + 5;
const int MOD = 998244353;
vector<int> spf(MAXN);
int add(int a, int b, int c = MOD) {int res = a + b; return (res >= c ? res % c : res);}
int sub(int a, int b, int c = MOD) {int res; if (abs(a - b) < c)res = a - ... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | a0e92eb809f79d8fb3b0d0c5d39cd611 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-falign-functions")
#pr... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | 6d484555c12995ad693ceadb07808bc6 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
// #pragma GCC optimize("-funsafe-loop-optimizations")
// #pragma GCC optimize("-funroll-loops")
// #pragma GCC optimize("-fwhole-program")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC optimize("-fthread-jumps")
// #pragma GCC optimize("-falig... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | 39998e7288f3bdb2ad145fb03b10c171 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
// #pragma GCC optimize("-funsafe-loop-optimizations")
// #pragma GCC optimize("-funroll-loops")
// #pragma GCC optimize("-fwhole-program")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC optimize("-fthread-jumps")
// #pragma GCC optimize("-falign-... | C++ | 4ce699a5633d6d3073c2daa7e10060bd | dc7a3ef536561e600ef5ddf71aa9ea4f | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n,i;
cin>>n;
string s;
cin>>s;
int xx;
for(xx=1;xx<n;xx++){
if(s[xx]=='?'){
if(s[xx-1]=='B'){
s[xx]='R';
}
el... | C++ | 280487a73e6070a7dc7deb44332d6319 | 9e8ddc7ae4d80c16dcb7fc91c7f08879 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
string s;
int main() {
int t;
cin>>t;
while(t--) {
int n;
int r = -1;
int l = r;
cin>>n>>s;
if(n == 1) {
if(s[0] == '?') {
s[0] = 'B';
cout<<s<<endl;
continue;
... | C++ | 280487a73e6070a7dc7deb44332d6319 | 4860613504c8868e11d06d268f194c22 | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int s[N],tot;
char a[N],xl[N],ans[N];
int main()
{
int T; cin>>T;
while(T--)
{
memset(ans,0,sizeof(ans));
memset(xl,0,sizeof(xl));
int n; cin>>n; tot = 0;
for(int i=1;i<=n;i++)
{
char ch=getchar();
while(ch!='?' && ch!='R' && ch... | C++ | 280487a73e6070a7dc7deb44332d6319 | faa77aa1440483afe22587625c019664 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
int l=-1,r=0;
for(int i=0;i<n;i++){
if(i==0 && s[i]=='?'){
l=0;
continue;
}
if(s[i]=='?'){
if(l==0) r++;
}
if(s[i]!='?'){
if(l==0){
for(int i=r;i>=0;i--... | C++ | 280487a73e6070a7dc7deb44332d6319 | f5d847bdabeb5f6248a44fc7a158b2f1 | 900 | PASSED |
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long int LLI;
LLI t,n,m,i,j,k,x,ans,p;
int main(){
cin>>t;
while(t--) {
cin>>n;
char s[200005];
cin>>s;
p=-1;
for(i=0;i<n;i++) {
if(s[i]!='?') {p=i;break;}
}
if(p==-1) fo... | C++ | 280487a73e6070a7dc7deb44332d6319 | 5e56b7d8851175b38934499f5203740b | 900 | PASSED |
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<string>
#define ll long long
using namespace std;
const int maxn=10005;
const int MOD=10005;
ll n,m;
string s;
int main(){
ll t;
scanf("%lld",&t);
while(t--){
scanf("%lld",&n);
cin>>s;
m=s.size();
ll a=0;
for(int i=0;i<m;i+... | C++ | 280487a73e6070a7dc7deb44332d6319 | 340cb6d1f2488e57d6b772dcd4d69e8f | 900 | PASSED |
#include<bits/stdc++.h>
#define pb emplace_back
#define nw cout<<"\n";
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define mpr make_pair
#define memset(v,x) memset(v,x,sizeof(v))
#define len(v) int(v.size())
#define put(v,x) v.insert(begin(v),x)
#define ... | C++ | 280487a73e6070a7dc7deb44332d6319 | 247f63b8029fc045cb1ab49fe95631c3 | 900 | PASSED |
#include<iostream>
#include<vector>
#include<cstdio>
#include<map>
#include<cstring>
#include<queue>
#include<string.h>
using namespace std;
typedef long long ll;
#define vll vector<ll>
#define vllvll vector<vll>
void solve(){
ll n;
cin>>n;
getchar();
vector<char>s,ss;
s.push_back('1');
for(int i=1;i<=n;i++){
c... | C++ | 280487a73e6070a7dc7deb44332d6319 | 7ce9953c3e3c8a888f3fe30dbcf66956 | 900 | PASSED |
// K0dEr :P
#include<bits/stdc++.h>
#define ff first
#define ss second
#define nn '\n'
#define mod 1000000007
#define read(_a, _n) for (ll i = 0; i < _n; i++) cin >> _a[i];
#define show(_a) for (auto &val : _a) cout << val << " ";
#define mx(_a) *max_element(_a.begin(), _a.end())
using namespace std;
#define ll long l... | C++ | 280487a73e6070a7dc7deb44332d6319 | 11dc73e6d23ad17d741120ea43f5cec6 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define TL ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int t,n;
string s;
char temp;
char print(char a)
{
if(a == 'B') return 'R';
else return 'B';
}
int main()
{
cin >> t;
while(t--)
{
cin >> n >> s;
if(n == 1 && s[0] == '?')... | C++ | 280487a73e6070a7dc7deb44332d6319 | 3fdac4265925cb5ad1c253635e7d52f6 | 900 | PASSED |
#include <iostream>
#include <vector>
using namespace std;
void execute() {
int n;
vector<int> v;
cin >> n;
for (int i = 0; i < n; i++) {
int input;
cin >> input;
v.push_back(input);
}
int x = v[0];
for (int i = 0; i < n; i++) {
x = (x & v[i]);
}
cout << x << endl;
}
i... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | cb097929d35855897cf84f8e71efaaf9 | 900 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool areSame(const vector<int> v, int n) {
const int v0 = v[0];
for (int i = 0; i < n; i++) {
if (v0 != v[i])
return false;
}
return true;
}
void alterVector(vector<int>& a, int n, int l, int r) {
for (int i = 0... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | a43d1474ac7ab260fca251423bae4537 | 900 | PASSED |
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int t, n[100];
int niz[100][101];
int main() {
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n[i];
for (int j = 0; j < n[i]; j++)
cin >> niz[i][j];
niz[i][n[i]] = -1;
}
for (int i = 0; i < t; i++) {
... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | 7174a65a43913d23ea4ec9a29d9c0d52 | 900 | PASSED |
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int t, n[100];
int niz[100][101];
int main() {
for (int i = 0; i < 100; i++)
for (int j = 0; j < 101; j++)
niz[i][j] = -1;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n[i];
for (int j = 0; j < n[i]; j++)
... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | c46bf9042c4d5312652931472e9c64c6 | 900 | PASSED |
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main() {
int mini;
int t, n[100];
int niz[100][150];
for (int i = 0; i < 100; i++)
for (int j = 0; j < 150; j++)
niz[i][j] = -1;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n[i];
for (int j = 0... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | 804bdb91b345cf228424aff94a6bf720 | 900 | PASSED |
// Mocha and Math.cpp : This file contains the 'main' function. Program execution begins and ends there.
//900
#include <iostream>
#include<vector>
int main()
{
long long int tcase,len=0,temp,max,min;
std::vector<long long int> sequence,MIN,rounds;
std::cin >> tcase;
for (int i = 0; i < tcase; i++)... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | b05853c58c151c88aeb8effc8c007a29 | 900 | PASSED |
// #include <bits/stdc++.h>
// #define int long long int
// #define endl "\n"
// #define cyes cout<<"YES\n"
// #define cno cout<<"NO\n"
// #define nline cout<<"\n"
// #define pb(x) emplace_back(x)
// #define vi vector<int>
// using namespace std;
// void fast(){
// cin.tie(NULL) ;
// ios_base::sy... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | 4393010a8ab8d6ee082ba7c7c75c3ee7 | 900 | PASSED |
// #include <bits/stdc++.h>
// #define int long long int
// #define endl "\n"
// #define cyes cout<<"YES\n"
// #define cno cout<<"NO\n"
// #define nline cout<<"\n"
// #define pb(x) emplace_back(x)
// #define vi vector<int>
// using namespace std;
// void fast(){
// cin.tie(NULL) ;
// ios_base::sy... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | 923b0825094a83af99173677a68d0c57 | 900 | PASSED |
#include <bits/stdc++.h>
#define int long long int
#define endl "\n"
#define cyes cout<<"YES\n"
#define cno cout<<"NO\n"
#define nline cout<<"\n"
#define pb(x) emplace_back(x)
#define vi vector<int>
using namespace std;
void fast(){
cin.tie(NULL) ;
ios_base::sync_with_stdio(false) ;
cout.ti... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | c333036cb8c8a2c36b57e524435c7673 | 900 | PASSED |
#include <bits/stdc++.h>
#define int long long int
#define endl "\n"
#define cyes cout<<"YES\n"
#define cno cout<<"NO\n"
#define nline cout<<"\n"
#define pb(x) emplace_back(x)
#define vi vector<int>
using namespace std;
void fast(){
cin.tie(NULL) ;
ios_base::sync_with_stdio(false) ;
cout.ti... | C++ | 4f8eac547bbd469a69de2f4aae4a87f0 | ccf52993abdfb9f5e5d56b4a939caa0f | 900 | PASSED |
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef long long ll;
const int N = 2e6 + 10;
int a[10003];
int main() {
int q;
cin >> q;
while (q--) {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
bool f = false;
if (a[1]) {
f = true;
cout << n + 1;
for ... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | 1fb809f9f30e4401c10bdb4475c5cb53 | 1,200 | PASSED |
#include<iostream>
#include<vector>
using namespace std;
int main(){
int t,n;
cin>>t;
for(int k=0;k<t;k++){
int n;
cin>>n;
vector<int> road;
for(int i=0;i<n;i++){
int d;
cin>>d;
road.push_back(d);
}
//if road[0]==1 ||road[n-1]==0
if(road[0]==1){
cout<<n+1<<" ";
for(int i=1;i<=n;i++)... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | aa0176f21466878736f294d83f0673c9 | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define el '\n'
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 1e9 + 5, mod = 1e9 + 7;
void solve(){
int n, m, last = 0;
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> m;
... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | a1d10a42b06d260c823ceacb1dd54ba1 | 1,200 | PASSED |
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
int t;
void okk()
{
int a[20009];
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
if(a[1]==1)
{
printf("%d ",n+1);
for(int i=1;i<=n;i++)
printf("%d ",i);
printf("\n");
}
else if(a[n]==0)
{
for(int i=1;... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | 0648ecf0b542c7fc30bc3820e5b6faac | 1,200 | PASSED |
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<map>
#include<deque>
#include<set>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long ll;
int const max_val = 2e5 + 5;
int const maxn = 1e4 + 5;
ll const modulo = 1e9 + 7;
int a[maxn], res[maxn];
int t, n, m, x;
signed mai... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | c1fc714c9f8c10c3f538a74ec66a83cf | 1,200 | PASSED |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <vector>
#include <queue>
#include <string>
#define IOS ios::sync_with_stdio(false)
#define PI acos(-1.0);
#define lowbit(x) (x & -x)
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
type... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | e70fc85cee1c448e6b12d258bc1e7315 | 1,200 | PASSED |
#include <iostream>
using namespace std;
const int N=2e5+66;
int a[N];
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
bool ok=false;
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
if(a[1]==1)
{
cout<<n+1<<" ";
for(int i=1;i<=n;i++)cout<<i<<" ";
cout<<endl;
continue;
}
else if(a[n]==0)
{
f... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | 3adc640567dae0753651ce43bcd944c9 | 1,200 | PASSED |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
int a[100100];
int main() {
int t,n;
cin>>t;
while(t--) {
scanf("%d", &n);
for(int i = 1; i <= n; i++) scanf("%d", &a[i]);
if(a[1]) {
printf("%d ", n + 1);
for(int i = 1;... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | 30f9a485011eaae79c7fa0797f083756 | 1,200 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
bool a[10010];
bool b[10010];
using namespace std;
void solve()
{
memset(a,false,sizeof(a));
memset(b,false,sizeof(b));
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
int x;
cin>>x;
if(x)b[i]=true;
else a[i]=true;
}
if(n==1)
{
if(a[1])
... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | c2a22e97ac23f4fea5ecc4d4ebe0e34b | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
int n, m, num[N];
int main()
{
int t;
cin >> t;
while (t--)
{
cin >> n;
for (int i = 1; i <= n; i++)
cin >> num[i];
int ind = -1;
if (num[1] == 1)
{
cout << n + 1 << ' ';... | C++ | 3f9525d74f4934eb9dca1b16c53662bf | 68446fcd7a0fe6c395316720d4b95bc6 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1e9+7;
const int INF=0x3f3f3f3f;
const int N = 1e5+10;
#define ios \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
int fa1[1100];
int fa2[1100];
int l[... | C++ | e3d2b67a62ac431718071ae20f3794aa | 2f5def3f0886ea6901ac8afb4dd46886 | 1,400 | PASSED |
#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#define endl '\n'
#define int long long
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N=2e5+2;
int t=1;
int a[N];
int... | C++ | e3d2b67a62ac431718071ae20f3794aa | 0ce44a4eccdd4f8aed79a1f37549cc41 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define go(i,a,b) for(int i=(a);i<(b);i++)
#define goe(i,a,b) for(int i=(a);i<=(b);i++)
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> pii;
int n,a,b,u,v;
int f1[1005],f2[1005];
int find1(int x){
return f1[x]==x?x:f1[x]=find1(f1[x]);
}
int... | C++ | e3d2b67a62ac431718071ae20f3794aa | b4e8e8cf04c1425516e241a42aff440a | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define Triple_A iostream::sync_with_stdio(false), cin.tie(NULL),cout.tie(NULL);
#define ll long long
#define ld long double
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define wloop int t; cin>>t; while (t--)
#define END cout<<endl;
const ll N = ... | C++ | e3d2b67a62ac431718071ae20f3794aa | de913e72a79745c986c87cc59a11048b | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lld;
#define endl '\n';
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
#define fast \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define all(v) ((v).begin()), ((v).end())
#define ... | C++ | e3d2b67a62ac431718071ae20f3794aa | 216b10d5f0ab8f57f0bd01a5dde43649 | 1,400 | 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 fs(n) fixed<<setprecision(n)
#define all(v) v.begin(),v.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
... | C++ | e3d2b67a62ac431718071ae20f3794aa | c6078dbbb51fb2c0d59f93c28e36debd | 1,400 | PASSED |
#include <bits/stdc++.h>
#define endl '\n'
#define etoo ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 1000+1;
int M[N+1] ,D[N+1];
int getParent(int x , int parent[])
{
if (parent[x] == x)return x;
return parent[x] = getParent(parent[x] , parent);
}
bool joinOnlyOne(int ... | C++ | e3d2b67a62ac431718071ae20f3794aa | a97fcdcfa7302198d9f412f1687705cd | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n , m1 , m2;
int par1[1001] , par2[1001],siz1[1001],siz2[1001] , vis[1001];
int fnd1(int a)
{
while(par1[a]!=a)a=par1[a];
return a;
}
bool uni1(int a , int b)
{
int one = fnd1(a);
int two = fnd1(b);
if(one==two)
return ... | C++ | e3d2b67a62ac431718071ae20f3794aa | db6ba77d0d4782a62f51f1aa4cb15506 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll finde(ll array[], ll x) {
if (array[x] == x) {
return x;
}
array[x] = finde(array, array[x]);
return array[x];
}
void dsuUn(ll array[], ll x, ll y) {
ll a = finde(array, x);
ll b = finde(array, y);
if (a != b) {
array[a] = b;
}
}
int m... | C++ | e3d2b67a62ac431718071ae20f3794aa | 21be60aadd549d8532a5e57f59f5b871 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n,m1,m2,u,v;
int x[1005],y[1005];
int find1(int a){
return a==x[a]?a:(x[a]=find1(x[a]));
}int find2(int a){
return a==y[a]?a:(y[a]=find2(y[a]));
}
int main(){
cin>>n>>m1>>m2;
for(int i=1;i<=n;i++){
x[i]=i;
y[i]=i;
}
for(int i=1;i<=m1;i++){
cin>>u>>v;
x[... | C++ | e3d2b67a62ac431718071ae20f3794aa | 1fd3e923c09dab4fbf21183314414723 | 1,400 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | 7d5646e8d637a4f150d8022eb1d52c01 | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | 22cc2349ec040d15c9908ae8558ac03e | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | 9a74f6998553eed6095718790ec740af | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | b5d7bde6636a2ebb75dcf72153adb2d9 | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | d5620c255bb6a953c8812e958443f362 | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | 086a567684dcc1643e9b8cf871467d95 | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (size_t i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b +... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | 4ff36f1cde6038bc9df8c28c4d08db9f | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <random>
#include <ctime>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
for (int i = 0; i < n; ++i) {
b[i] = {};
}
(*this)(b, b + n)... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | fca89c92911e7269ff896fd289d090f8 | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cstring>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
memset(b, 0, sizeof *b * n);
(*this)(b, b + n);
}
template <t... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | 4962d37050086dd406c9e48fb55f4e1b | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cstring>
struct UnsafeInput {
UnsafeInput() {
fread(buf + 1, 1, sizeof buf - 1, stdin);
}
template <typename T>
void operator()(T* b, size_t n) {
memset(b, 0, sizeof *b * n);
(*this)(b, b + n);
}
template <t... | C++ | 1bf6e28c366b555664a3a6d2c0ded909 | b43d44e2945e2c5e13d332a673bda7bd | 2,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n,m,s,l;
const int mo=1e9+7;
const int inv3=333333336;
#define sqr(x) (1ll*(x)*(x)%mo)
int a[202020],b[202020],c[202020],sum[202020],sum2[202020];
long long gcd_ex(long long a,long long b,long long &x,long long &y){
if(b==0){
x=1;
y=0;
return 1ll*a;
... | C++ | effad8359672ab401c16ec8edd2a3c69 | e75d65ed797cdaa38fdde0c78aafeee0 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n,m,s,l;
const int mo=1e9+7;
const int inv3=333333336;
#define sqr(x) (1ll*(x)*(x)%mo)
int a[202020];
int b[202020];
int c[202020];
int sum[202020];
int sum2[202020];
long long gcd_ex(long long a,long long b,long long &x,long long &y){
if(b==0){
x=1;
... | C++ | effad8359672ab401c16ec8edd2a3c69 | d818cb50a1c9e0ef4ecce0ac68548492 | 2,700 | PASSED |
#include<bits/stdc++.h>
#define int long long
using namespace std;
int T;
int n;
int a,b,_a,_b;
int la,lb,l_a,l_b;
int ans;
int readchar(){
char xx=0;
while(xx!='l' && xx!='r') xx=getchar();
if(xx=='l'){
for(int i=1;i<=3;i++) xx=getchar();
return 0;
}
else{
for(int i=1;i<=4;i++) xx=getchar();... | C++ | de598bc77a60b2770877895fb41897bb | ded48360212a2f05cb5a24cb0b782b70 | 3,100 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll... | C++ | de598bc77a60b2770877895fb41897bb | 58673f44ce9e3217b6e7930886a93cae | 3,100 | PASSED |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
#define rep1n(i, n) for (int i = 1; i <= (n); ++i)
#define repr(i, n) for (int i = (n) - 1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
... | C++ | de598bc77a60b2770877895fb41897bb | 16b900477e0dc5772afa29a32476c562 | 3,100 | PASSED |
#include<bits/stdc++.h>
#define int long long
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define rd(x) x=read()
#define wt(x) write(x)
#define pos(x) (((x)-1)/SZ+1)
#define endl "\n"
#define pii pair<int,... | C++ | de598bc77a60b2770877895fb41897bb | 94688ede4abb9597b0ba46dd172eb7e4 | 3,100 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <experimental/random>
class EmptyList { };
class EmptyDict { };
template <class T, class S>
struct CommonType { };
struct String;
template <class T>
struct List {
std::shared_ptr<std::vector<T>> inne... | C++ | de598bc77a60b2770877895fb41897bb | 32800eb0d79e3f03e76cafcf106f294f | 3,100 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <experimental/random>
class EmptyList { };
class EmptyDict { };
template <class T, class S>
struct CommonType { };
struct String;
template <class T>
struct List {
std::shared_ptr<std::vector<T>> inne... | C++ | de598bc77a60b2770877895fb41897bb | c14d38dac15f108aa6415dd28b627a8d | 3,100 | PASSED |
#define FASTIO
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define BE(x) (x).begin(), (x).end()
#define y1 ___y1
#define max mymax
#define min mymin
#define pq priority_queue
#define FOR(i, l, r) for (int i = (l), i##end = (r); i <= i##en... | C++ | de598bc77a60b2770877895fb41897bb | 51e44f34e8712344900525dfd84c5fcc | 3,100 | PASSED |
#define FASTIO
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define BE(x) (x).begin(), (x).end()
#define y1 ___y1
#define max mymax
#define min mymin
#define pq priority_queue
#define FOR(i, l, r) for (int i = (l), i##end = (r); i <= i##en... | C++ | de598bc77a60b2770877895fb41897bb | c606098d0229b49cf7466d3ab53f157f | 3,100 | PASSED |
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=2e6+101;
inline int read() {
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar();}
while(ch>='0'&&ch<='9') { s=s*10+ch-'0'; ch=getchar();}
return s*w;
}
char c1[11],c2[11];
signed main(... | C++ | de598bc77a60b2770877895fb41897bb | b345b63f7b6694107017abf6d2b5b58a | 3,100 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
const int N=100050;
const int M=2*N;
const int L=18;
struct vec2{
ll x,y;
int idx;
vec2(){}
vec2(ll a,ll b):x(a),y(b){}
vec2 operator - (vec2 other) const {
return vec2(x-other.x,y-other.y);
}... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | 8cb9bfd375da73406c2d4b7cf333abc6 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
const int N=100050;
const int M=2*N;
const int L=18;
struct vec2{
ll x,y;
int idx;
vec2(){}
vec2(ll a,ll b):x(a),y(b){}
vec2 operator - (vec2 other) const {
return vec2(x-other.x,y-other.y);
}... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | b2d4d8311944cd03b02e987e997839bc | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
const int N=100050;
const int M=2*N;
const int L=18;
struct vec2{
ll x,y;
int idx;
vec2(){}
vec2(ll a,ll b):x(a),y(b){}
vec2 operator - (vec2 other) const {
return vec2(x-other.x,y-other.y);
}... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | f4700c26215668f6bffe2313a32fe2ac | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
const int N=100050;
const int M=2*N;
const int L=18;
struct vec2{
ll x,y;
int idx;
vec2(){}
vec2(ll a,ll b):x(a),y(b){}
vec2 operator - (vec2 other) const {
return vec2(x-other.x,y-other.y);
}... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | 88a7fca36bced3d3004a5d74d982670c | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using Point = complex<int>;
using ll = long long;
ll cross(Point a, Point b) { return 1LL * a.real() * b.imag() - 1LL * b.real() * a.imag(); }
ll det(Point a, Point b, Point c) { return cross(b - a, c - a); }
namespace std {
bool operator<(const Point& a, const Poi... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | e20ad185c13b4366ade95f7f905cd8e2 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
const int N=100050;
const int M=2*N;
const int L=18;
struct vec2{
ll x,y;
int idx;
vec2(){}
vec2(ll a,ll b):x(a),y(b){}
vec2 operator - (vec2 other) const {
return vec2(x-other.x,y-other.y);
}... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | 5fecb934d4a7c94ad5a5319f2d8e6826 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using Point = complex<int>;
using ll = long long;
ll cross(Point a, Point b) { return 1LL * a.real() * b.imag() - 1LL * b.real() * a.imag(); }
ll det(Point a, Point b, Point c) { return cross(b - a, c - a); }
namespace std {
bool operator<(const Point& a, const Poi... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | 3ec2b49fe170a338133a3a55ade3aecc | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
// pairs
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
#define mp make_pair
#define f first
#define s second
#define... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | 659e36f0259ed1549618922f58105026 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
// pairs
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
#define mp make_pair
#define f first
#define s second
#define... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | ca3f45e532f84ede24d38dc697491dfb | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
// pairs
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
#define mp make_pair
#define f first
#define s second
#define... | C++ | bb5ec56dec0853caff4fdff2fe589ac7 | b489bf772e2f58b90ac9c3443d2db52a | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
#define x first
#define y second
#define int long long
// queries are between VERTEXES including both ends
// if u want do smth on edges - add vertex on every edge!!!!
class LinkCutTree {
private:
struct Ver... | C++ | 0cf658d88cae1745a768a25153f62890 | ce41a05d20e4fc7c9948c2b7c982183b | 2,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
... | C++ | 0cf658d88cae1745a768a25153f62890 | 37087335041ea0b478d7eae64fab7450 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 2.5e5 + 5;
const int MAXM = 5e5 + 5;
namespace LCT
{
struct Node
{
Node *fa;
union{ Node *son[2]; struct{ Node *ls,*rs;};};
bool rev_tag;
int vtag, val, mx;
Node(void){}
Node(No... | C++ | 0cf658d88cae1745a768a25153f62890 | b57c40de4a813642412c594c08e75ffd | 2,700 | PASSED |
// 南无加特林菩萨,六根清净贫铀弹,一息三千六百转,大慈大悲度世人
// 1111
#include <bits/stdc++.h>
using namespace std;
#define OPENIOBUF
namespace FastIO
{
class FastIOBase
{
protected:
#ifdef OPENIOBUF
static const int BUFSIZE=1<<22;
char buf[BUFSIZE+1];
int buf_p=0;
#endif
FILE *target;
public:
#ifdef OPENIOBUF
virtual void flus... | C++ | 0cf658d88cae1745a768a25153f62890 | 90540efd0096797452a6166b0ce0616a | 2,700 | PASSED |
//南无加特林菩萨,六根清净贫铀弹,一息三千六百转,大慈大悲度世人
#include <bits/stdc++.h>
using namespace std;
#define OPENIOBUF
namespace FastIO
{
class FastIOBase
{
protected:
#ifdef OPENIOBUF
static const int BUFSIZE=1<<22;
char buf[BUFSIZE+1];
int buf_p=0;
#endif
FILE *target;
public:
#ifdef OPENIOBUF
virtual void flush()=0;
#e... | C++ | 0cf658d88cae1745a768a25153f62890 | 6f8cd4509288e223e1d53afe99c2ef76 | 2,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define OPENIOBUF
namespace FastIO
{
class FastIOBase
{
protected:
#ifdef OPENIOBUF
static const int BUFSIZE=1<<22;
char buf[BUFSIZE+1];
int buf_p=0;
#endif
FILE *target;
public:
#ifdef OPENIOBUF
virtual void flush()=0;
#endif
FastIOBase(FILE *f): target... | C++ | 0cf658d88cae1745a768a25153f62890 | 6909e695c5fc11fb02c4f1ce38e92289 | 2,700 | PASSED |
#define ssh(x)<x>
#include ssh(bits/stdc++.h)
#define rfor(x...)for(register x)
#define rep(i,l,r)rfor(ll i=l;i<=r;i++)
#define ref(i,l,r)rfor(ll i=l;i<r;i++)
#define per(i,l,r)rfor(ll i=l;i>=r;i--)
#define rev(i,u,v)rfor(ll i=head[u],v;v=to[i],i;i=next[i])
#define rej(i,s)rfor(ll i=s;i;i=(i-1)&(s))
#define red(i,n)rfo... | C++ | 0cf658d88cae1745a768a25153f62890 | 20861fbb019eb84a303782c2ca64aa68 | 2,700 | PASSED |
// Copyright 2021 Nikita Golikov
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#ifdef GOLIKOV
#define debug(x) cerr << (#x) << ":\t" << (x) << endl
#else
#define debug(x) 238;
#endif
template <class A, class B... | C++ | 0cf658d88cae1745a768a25153f62890 | 63eff196b73416c649fe8b42b6594245 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int M=1000000007;
const int N=1000005;
int n,i,ch[N][2],fa[N],rev[N],mx[N],k,m,j,u[N],v[N];
struct str{int u,v;}e[N];
int lazy[N],w[N];
void pushup(int x)
{
mx[x]=mx[ch[x][0]]|mx[ch[x][1]]|(x>n?w[x]:0);
}
void pushdown(int x)
{
if(rev[x])
rev[ch[x]... | C++ | 0cf658d88cae1745a768a25153f62890 | 61b334af3002dce8bfde97661a08326c | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
const int N=1e6+5;
typedef long long ll;
struct Lct
{
int n,m,id[N],root,a[N],t[N][2],mn[N],fa[N],lz[N],s[N],si[N];
bool rev[N];
int U[N],V[N];
void pushup(int x)
{
s[x]=s[t[x][0]]+s[t[x][1]]+a[x];
si[x]=si[t[x][0]]+s... | C++ | 0cf658d88cae1745a768a25153f62890 | 13026c5930746961b3fee525f619ad4e | 2,700 | PASSED |
#include<stdio.h>
#include<string.h>
#include<immintrin.h>
#include<emmintrin.h>
#pragma GCC optimize("O2")
#pragma GCC target("avx2")
#pragma GCC optimize("-fno-strict-aliasing")
#define U unsigned
#define LL long long
#define UL U LL
#define mod 1000000007u
#define dmod 2000000016u
#define ymm __m256i
... | C++ | 4f7ff35e722fc447cad3da41d5b59cb7 | 776bc87a2e46ccb77c3b944367e632f3 | 3,200 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.