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
from bisect import insort for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = [] smallest_towers = list(range(1,M+1)) blocks_positions = [] ...
Python
57df7947bb90328f543b984833a78e64
d53925792f9ad7250ad867c72741c511
1,400
PASSED
from bisect import insort for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = [] *smallest_towers, = range(1,M+1) blocks_positions = [] ...
Python
57df7947bb90328f543b984833a78e64
22d181d73308ed1e7dd4ff9522f6a0ff
1,400
PASSED
from bisect import insort for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = [] smallest_towers = towers[0] = list(range(1,M+1)) blocks_positio...
Python
57df7947bb90328f543b984833a78e64
d970c3ea8a5cba5455e7ed2d2b63c978
1,400
PASSED
from bisect import insort for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = [] smallest_towers = towers[0] = list(range(1,M+1)) blocks_positio...
Python
57df7947bb90328f543b984833a78e64
e9104e820c39d9e04d3c6ef89231225c
1,400
PASSED
from bisect import insort from array import array for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = [] smallest_towers = towers[0] = list(range(1,M...
Python
57df7947bb90328f543b984833a78e64
e604bf959d47168477401e0bafe37a44
1,400
PASSED
from bisect import insort from array import array for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = array("i") smallest_towers = towers[0] = array(...
Python
57df7947bb90328f543b984833a78e64
77a6667e8ac2e4dbac495525d164cd30
1,400
PASSED
from bisect import insort from array import array for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = array("i") smallest_towers = towers[0] = array(...
Python
57df7947bb90328f543b984833a78e64
d68e9ecf0a05f2970ff8af747fc11e0f
1,400
PASSED
from bisect import insort from array import array for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = {} smallest_height = 0 heights = array("i") smallest_towers = towers[0] = list(r...
Python
57df7947bb90328f543b984833a78e64
28a5a556f04e4daa7df2433b9a7c7aa4
1,400
PASSED
from collections import defaultdict from bisect import insort for _ in range(int(input())): N,M,X = map(int,input().split()) blocks_heights = map(int,input().split()) if N<M:print("NO");continue print("YES") towers = defaultdict(list) smallest_height = 0 heights = [] smallest_towers =...
Python
57df7947bb90328f543b984833a78e64
a1defba6a500b43f6fc3e2cac4fc6efb
1,400
PASSED
#include <bits/stdc++.h> #define lli long long int; using namespace std; int main(){ int t; cin>>t; while (t--){ int a; cin>>a; // if (((double)(sqrt((double)a/2)))==((int)(sqrt((double)a/2)))){ // cout<<"YES"; // } // else{ // ...
C++
6ae754639d96790c890f9d1ab259332a
a862862e2c10dc35f0e07ae866edf517
1,000
PASSED
#include <bits/stdc++.h> #define lli long long int using namespace std; int main(){ lli t; cin>>t; while(t--){ lli n; cin>>n; lli cond=0; if (n%2==0){ lli a=n/2; for (lli i=1; i<=sqrt(a); i++){ ...
C++
6ae754639d96790c890f9d1ab259332a
f9c1030cbd3ee0ac677ab07d2c047151
1,000
PASSED
#include<bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vl; typedef pair<int,int> pi; typedef pair<long long, long long> pl; #define pb pu...
C++
6ae754639d96790c890f9d1ab259332a
d7e7d70069c42c7735395044d487f106
1,000
PASSED
#include<bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vl; typedef pair<int,int> pi; typedef pair<long long, long long> pl; #define pb pu...
C++
6ae754639d96790c890f9d1ab259332a
79d78713b4396752f3da90bdbcc25b6c
1,000
PASSED
#include<bits/stdc++.h> using namespace std; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vl; typedef pair<int,int> pi; typedef pair<long long, long long> pl; #define pb pu...
C++
6ae754639d96790c890f9d1ab259332a
e598ccc0ff8a0f9d2bdc16fd6935350a
1,000
PASSED
#include<iostream> #include<algorithm> #include<set> #include<vector> #include<map> #include<list> #include<stack> #include<string> #include<cmath> #include<numeric> #include<iomanip> #include <cstring> #include<iterator> #include<queue> #include<bitset> #define ll long long #define ld long double #d...
C++
6ae754639d96790c890f9d1ab259332a
b175cbca8fce75bb84f1716ac083297b
1,000
PASSED
#include <iostream> #include <fstream> #include <vector> #include <cmath> #include <climits> #include <algorithm> #include <string> #include<set> #include <map> #include <iomanip> using std::cin; using std::cout; template <typename T> T _min2(T a, T b); template <typename T> T _max2(T a, T b); template ...
C++
6ae754639d96790c890f9d1ab259332a
a5a5a25b05ad903b739fd8f77a727cfa
1,000
PASSED
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define rep(i,a,b) for (int i = a; i < b; ++i) #define per(i,a) for (int i = a; i >= 0; --i) #define all(v) v.begin(), v.end() typedef vector<string> vs; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll...
C++
6ae754639d96790c890f9d1ab259332a
a53ad7f53930f5dc9b7168791e8d191e
1,000
PASSED
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define rep(i,a,b) for (int i = a; i < b; ++i) #define per(i,a) for (int i = a; i >= 0; --i) #define all(v) v.begin(), v.end() typedef vector<string> vs; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll...
C++
6ae754639d96790c890f9d1ab259332a
abdba47d8a7a7fae40ac9f1def4663c9
1,000
PASSED
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define rep(i,a,b) for (int i = a; i < b; ++i) #define per(i,a) for (int i = a; i >= 0; --i) #define all(v) v.begin(), v.end() typedef vector<string> vs; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll...
C++
6ae754639d96790c890f9d1ab259332a
241f323c34c472feb7b828615fe35438
1,000
PASSED
using System; using System.Collections.Generic; using System.IO; using System.Linq; using static System.Math; using System.Text; using System.Threading; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Library; namespace Program { public s...
C#
85383c9e802348a3153e7f98ce278f09
51c5416fed98c4894aa5c4f85fea4a21
800
PASSED
using System; using System.Collections.Generic; using System.Linq; namespace Cff { static class Program { private static void Deconstruct<T>(this T[] arr, out T v1, out T v2) { v1 = arr[0]; v2 = arr[1]; } public static void Main(string[] args) { uint t = Convert.ToUInt32(Console.R...
C#
85383c9e802348a3153e7f98ce278f09
019d1ce66275187e387574e85ae6632f
800
PASSED
using System; namespace TestProject { class Program { static void Main(string[] args) { var t = Convert.ToInt32(Console.ReadLine()); while (t-- != 0) { var s = Console.ReadLine(); var n = Convert.ToInt32(s.Split(' '...
C#
85383c9e802348a3153e7f98ce278f09
f58e86182b84390f310ee10ee8b5a529
800
PASSED
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Numerics; using System.Text; namespace Hacking { #if ONLINE_JUDGE #else //using Library; #endif ...
C#
85383c9e802348a3153e7f98ce278f09
b5c4cea5f313cd51300fb8148d297113
800
PASSED
using System.Linq; using System.Collections.Generic; using static System.Math; using System; public class hello { static void Main() { var t = int.Parse(Console.ReadLine().Trim()); while (t-- > 0) { string[] line = Console.ReadLine().Trim().Split(' '); ...
C#
85383c9e802348a3153e7f98ce278f09
afbb5476a5a4e3d33bf682f1322472c9
800
PASSED
using System.Linq; using System.Collections.Generic; using static System.Math; using System; public class hello { static void Main() { var t = int.Parse(Console.ReadLine().Trim()); while (t-- > 0) { string[] line = Console.ReadLine().Trim().Split(' '); ...
C#
85383c9e802348a3153e7f98ce278f09
7a8225a13d4f07c1330cdef77a04ede7
800
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Phoenix_and_Gold { internal class Program { static void Main(string[] args) { int input_1 = Convert.ToInt32(Console.ReadLine()), temp_2 = 0, temp...
C#
85383c9e802348a3153e7f98ce278f09
188fb4dd1a17b4fd59ead3b372118f81
800
PASSED
using System; using System.Collections.Generic; using System.Linq; namespace Cff { static class Program { private static void Deconstruct<T>(this T[] arr, out T v1, out T v2) { v1 = arr[0]; v2 = arr[1]; } public static void Main(string[] args) { uint t = Convert.ToUInt32(Console.R...
C#
85383c9e802348a3153e7f98ce278f09
81947c150d75528b0b98a896e0df0221
800
PASSED
using System; using System.Collections.Generic; using System.Linq; namespace Cff { static class Program { private static void Deconstruct<T>(this T[] arr, out T v1, out T v2) { v1 = arr[0]; v2 = arr[1]; } public static void Main(string[] args) { uint t = Convert.ToUInt32(Console.R...
C#
85383c9e802348a3153e7f98ce278f09
314163c84a80805e873e9b35c6965ec9
800
PASSED
using System; using System.Collections.Generic; using System.Linq; namespace ConsoleApp2 { public class Program { static void Main(string[] args) { int t = Int32.Parse(Console.ReadLine()); while (t > 0) { var input = Console.Rea...
C#
85383c9e802348a3153e7f98ce278f09
9503a35508314a8a8aec7e250c69475d
800
PASSED
#pragma GCC optimize("Ofast") #pragma GCC optimize ("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define MAXN 200005 #define MAXH 21 typedef long long ll; const int MAXA = (1 << MAXH) - 1; using namespace std; struct node { //mask0,m...
C++
5c2022d38053b202ed071a0ae6eee16f
4958463e89d851d1ec80bbab7f815a10
3,500
PASSED
#pragma GCC optimize("Ofast") #pragma GCC optimize ("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define MAXN 200005 #define MAXH 21 typedef long long ll; const int MAXA = (1 << MAXH) - 1; using namespace std; struct node { //mask0,m...
C++
5c2022d38053b202ed071a0ae6eee16f
a4925ffcee9fbd42e81c844b69bf5a51
3,500
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1048576,C=20; int Ri(){ int x=0; char c=getchar(); for (;c<'0'||c>'9';c=getchar()); for (;c<='9'&&c>='0';c=getchar()) x=x*10+c-'0'; return x; } int n,cq; struct tree{ int s[2],cnt,all[2],rev; }tr[N*2+9]; in...
C++
5c2022d38053b202ed071a0ae6eee16f
eba8065c00a133ec3aee0a5f9babc137
3,500
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1048576,C=20; int Ri(){ int x=0; char c=getchar(); for (;c<'0'||c>'9';c=getchar()); for (;c<='9'&&c>='0';c=getchar()) x=x*10+c-'0'; return x; } int n,cq; struct tree{ int s[2],cnt,all[2],rev; }tr[N*10+9]; i...
C++
5c2022d38053b202ed071a0ae6eee16f
68c15553706791d589cfb5a0b03d6269
3,500
PASSED
#include<stdio.h> const int maxn=200005,maxk=maxn*40; int n,q,k,rt,cnt; int lc[maxk],rc[maxk],lazy[maxk],Vand[maxk],Vor[maxk],res[maxk]; inline void swp(int &a,int &b){ a+=b,b=a-b,a-=b; } inline void pushup(int now){ Vand[now]=Vand[lc[now]]|Vand[rc[now]]; Vor[now]=Vor[lc[now]]|Vor[rc[now]]; res[now]=res[l...
C++
5c2022d38053b202ed071a0ae6eee16f
4d1e0cef1a18be35a13c56d71443f573
3,500
PASSED
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;++i) #define repn(i,n) for(int i=1;i<=n;++i) #define LL long long #define pii pair <int,int> #define pb push_back #define fi first #define se second #define mpr make_pair using namespace std; const LL MOD=1e9+7; int n,q,len=0,root=0; struct...
C++
5c2022d38053b202ed071a0ae6eee16f
ff5ebc1eae95d7a5b3d3bba44b951a6e
3,500
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define FILENAME sadcactus #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u...
C++
5c2022d38053b202ed071a0ae6eee16f
43e45e2e92efa45c3d0681d2467d1f2e
3,500
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define FILENAME sadcactus #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u...
C++
5c2022d38053b202ed071a0ae6eee16f
50952e0d0f4ad822245c897beeba7c61
3,500
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define FILENAME sadcactus #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u...
C++
5c2022d38053b202ed071a0ae6eee16f
6091f94d555cecdf7e1825ba46208823
3,500
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES //#define FILENAME sadcactus #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_u...
C++
5c2022d38053b202ed071a0ae6eee16f
2b9391ad87f17e703e3f9356e865bd28
3,500
PASSED
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; struct DSU { std::vector<int> f, siz; DSU(int n) : f(n), siz(n, 1) { std::iota(f.begin(), f.end(), 0); } int leader(int x) { while (x != f[x]) x = f[x] = f[f[x]]; return x; } ...
C++
6e29bc30ad110c69a069bb8471a6ed99
aa5177764ee4804cb9f09aaf22e646d0
2,600
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long inline ll read() { ll x = 0, f = 1; char ch = getchar(); for(; ch < '0' || ch>'9'; ch = getchar()) if(ch == '-') f = -f; for(; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0'; return x * f; } ...
C++
6e29bc30ad110c69a069bb8471a6ed99
01539e68b3d1048713265e524c7cdc0c
2,600
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long inline ll read() { ll x = 0, f = 1; char ch = getchar(); for(; ch < '0' || ch>'9'; ch = getchar()) if(ch == '-') f = -f; for(; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0'; return x * f; } ...
C++
6e29bc30ad110c69a069bb8471a6ed99
8ed26c6e6b07b5fbea2b463fcd6402ab
2,600
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long inline ll read() { ll x = 0, f = 1; char ch = getchar(); for(; ch < '0' || ch>'9'; ch = getchar()) if(ch == '-') f = -f; for(; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0'; return x * f; } ...
C++
6e29bc30ad110c69a069bb8471a6ed99
974bbf2fbc07b9dbce4e8b96be3751a8
2,600
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long inline ll read() { ll x = 0, f = 1; char ch = getchar(); for(; ch < '0' || ch>'9'; ch = getchar()) if(ch == '-') f = -f; for(; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0'; return x * f; } ...
C++
6e29bc30ad110c69a069bb8471a6ed99
acf093a25f740af1a9a1875ca5e88aba
2,600
PASSED
#include<bits/stdc++.h> #define ll long long #define fi first #define se second #define mp make_pair #define pb push_back #define pii pair<int,int> using namespace std; int n,m;ll x; ll a[300005]; int fa[300005]; set<pii> st[300005]; int fnd(int xx){ return fa[xx]==xx?xx:fa[xx]=fnd(fa[xx]); } pair<ll,in...
C++
6e29bc30ad110c69a069bb8471a6ed99
5bff77b391bbbeb736b102b8b7acdac0
2,600
PASSED
#include <bits/stdc++.h> #define ll long long #define fl float #define pb push_back #define pf push_front #define mk make_pair #define fr front() #define bc back() #define ft first #define sd second #define tp top() #define pp pop() #define bn begin() #define ed end() #define sz size() #define em empty()...
C++
6e29bc30ad110c69a069bb8471a6ed99
76ff546ea84b001b4879a492087185c7
2,600
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e6 + 10; ll f[maxn]; ll a[maxn]; ll find(ll x) { return (x == f[x]) ? x : f[x] = find(f[x]); //并查集 } int main() { priority_queue<pair<ll, ll>> pq; //优先队列存的是权+编号。 vector<vector<pair<ll, ll>>> v(ma...
C++
6e29bc30ad110c69a069bb8471a6ed99
85a0c07406bdf4133f363484172d64b9
2,600
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e6 + 10; ll f[maxn]; ll a[maxn]; ll find(ll x) { return (x == f[x]) ? x : f[x] = find(f[x]); //并查集 } int main() { priority_queue<pair<ll, ll>> pq; vector<vector<pair<ll, ll>>> v(maxn); pair<ll, l...
C++
6e29bc30ad110c69a069bb8471a6ed99
598cacaed46c2b205d0d0108a1ae5ea0
2,600
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn =1e6+10; ll f[maxn]; ll a[maxn]; ll find(ll x) { return (x == f[x]) ? x : f[x] = find(f[x]); } int main() { priority_queue<pair<ll, ll>> pq; vector<vector<pair<ll, ll>>> v(maxn); pair<ll, ll> tmp; ...
C++
6e29bc30ad110c69a069bb8471a6ed99
1c16f7baf869a0ab82bc077637872f31
2,600
PASSED
#include <cstdio> #include <cctype> #include <cstring> #include <algorithm> #include <numeric> #include <vector> #include <cassert> using namespace std; #define LOG(f...) fprintf(stderr, f) #define DBG(f...) printf("%3d: ", __LINE__), printf(f) // #define DBG(f...) void() #define all(cont) begin(cont), end...
C++
4f8be14ad3242c2832f37cca8feaeec0
c2dcfb3c1690cbe0939511d4dcfe83f2
2,700
PASSED
#include<bits/stdc++.h> #define f first #define s second #define int long long #define pii pair<int,int> using namespace std; const int N = 2e5 + 5, mod = 1e9 + 7; // ! int t, g[N], f[N], G = 0, h[N]; vector<pii> V[2][N]; stack<int> st; vector<int> x; void dfs(int u) { f[u] = 1; for(int i = 0; i < ...
C++
4f8be14ad3242c2832f37cca8feaeec0
451d7ae15c39dc83da45d7f81d39a26d
2,700
PASSED
#include <cstdio> #include <algorithm> #include <vector> #include <cstring> #include <iostream> #include <random> using namespace std; #define fi first #define sc second typedef long long ll; const int N=2e5+5,M=1505,oo=1e9,mod=1e9+7; int n,m,hd1[N],hd2[N],num1,num2,q; struct node { int nxt,to,s; }e1[N],e2[N]; inli...
C++
4f8be14ad3242c2832f37cca8feaeec0
f37e14137c7cc6bd4e292211acc3bb7a
2,700
PASSED
#include <cstdio> #define rep(i, d, u) for(int i = d; i <= u; ++i) #define cep(n) while(n--) #define gep(i, a) for(int i = firs[a]; i; i = neig[i]) int ured() { int re = 0; char ch; do { ch = getchar(); } while('9' < ch || ch < '0'); do { re = re * 10 + (ch ^ '0'); } while('0' <= (ch = getchar()) ...
C++
4f8be14ad3242c2832f37cca8feaeec0
e719fe0fc28f58ad8b85b2714dd82ab9
2,700
PASSED
#include<bits/stdc++.h> using namespace std; mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); #define ll long long #define pb push_back #define ld long double const ll INF = 1e18; const int N = 2e5 + 10; int cnt = 1; bool used[N]; vector<ll> d(N, INF); vector<int> ord, gr...
C++
4f8be14ad3242c2832f37cca8feaeec0
f6aa75e5944aeea9cf02ae463cffd458
2,700
PASSED
#include<cstdio> #include<vector> #include<algorithm> #include<stack> struct graph { struct edge{int to;long long w;edge(int to=0,long long w=0){this->to=to,this->w=w;}}; std::vector<edge> a[200005]; int n,cnt,vis[200005],used[200005],low[200005],dfn[200005],ins[200005],id[200005],cc; long long dep[200005]...
C++
4f8be14ad3242c2832f37cca8feaeec0
f47db65657124721b8679e45659f2681
2,700
PASSED
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <...
C++
4f8be14ad3242c2832f37cca8feaeec0
7d61e091306735199d1e0ad6d671445b
2,700
PASSED
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <...
C++
4f8be14ad3242c2832f37cca8feaeec0
7b3578486f4dc70a98babe1b50cfab56
2,700
PASSED
#include <iostream> #include <algorithm> #include <iomanip> #include <vector> #include <queue> #include <deque> #include <set> #include <map> #include <tuple> #include <cmath> #include <numeric> #include <functional> #include <cassert> #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x...
C++
4f8be14ad3242c2832f37cca8feaeec0
c4ef7842aea69377bd6c0b04c5f19f9a
2,700
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define eb emplace_back #define pb push_back #define fi first #define se second #define all(x) (x).begin(),(x).end() #define SZ(x) (int)x.size() mt19937 mrand(random_device{}...
C++
4f8be14ad3242c2832f37cca8feaeec0
75fc27bd5d94f62a71b317f9dfd83b61
2,700
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int lim, length; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
8ddd48d5b723bfaf940b5ee3aadc9e32
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/fenwick_tree.h" template <typename T, typename = enable_if_t<is_integral_v<T>>> struct fenwick_tree { int n, logn; vector<T> data; T& operator [] (int i) { return data[i]; } fenwick_tree(int ...
C++
e58888a75a38254e71f3153cc8304704
ed6275f5a68fb2f77ca37f71656efe1f
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
1fdd185a2ef4c80fba4f1b4228ae8d5d
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
39b170bdfc499d5ebec5b619974045fc
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
7dec31c2ce9d25d1695385d9f6070fa8
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
bb2fea243712d7d7d741a3e4b7e4d3aa
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
a2cf65d427270ca13a2d4d174efacebf
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
db1a7e3941610604ba9c4787fc63f859
3,400
PASSED
#pragma GCC optimize("O3") #pragma GCC target("sse4,avx2") #include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, li...
C++
e58888a75a38254e71f3153cc8304704
52bb37d9f1afae98183e2347358f6fe0
3,400
PASSED
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES // START #include "../../../lca/data_structure/segment_tree.h" template <class Node_t, typename Query_t, bool push = true, bool break_cond = false> struct segment_tree { int length, lim; vector<Node_t> data; Node_t& operator [] (int i) { re...
C++
e58888a75a38254e71f3153cc8304704
095321b39b81f01b0d0d19ac82252811
3,400
PASSED
#include<bits/stdc++.h> #include<chrono> #define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define all(s) s.begin(),s.end() #define gcd __gcd #define setbits(x) __builtin_popcountll(x) #define binarystring(n,x) bitset<n> (x).to_string() #define zrobits(x) __builtin_ctzll(...
C++
f32b9d3b5c93e566e16c1de963a159a8
07099335e864378baf7c6badac5ab6a3
2,400
PASSED
//HEADER FILES AND NAMESPACES #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // #include <sys/resource.h> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order...
C++
f32b9d3b5c93e566e16c1de963a159a8
f0bc441e5f6e915ce41c56d1cef496f2
2,400
PASSED
#include<bits/stdc++.h> using namespace std; template<typename T1, typename T2> istream& operator>>(istream& ins, pair<T1, T2>& v) { ins >> v.first >> v.second; return ins; } template<typename T, size_t N> istream& operator>>(istream& ins, array<T, N>& v) { for (int i = 0; i < int(N); i++) cin >>...
C++
f32b9d3b5c93e566e16c1de963a159a8
d38cf32fce04bc327050fbbbaeae6713
2,400
PASSED
#include<bits/stdc++.h> using namespace std; template<typename T1, typename T2> istream& operator>>(istream& ins, pair<T1, T2>& v) { ins >> v.first >> v.second; return ins; } template<typename T, size_t N> istream& operator>>(istream& ins, array<T, N>& v) { for (int i = 0; i < int(N); i++) cin >>...
C++
f32b9d3b5c93e566e16c1de963a159a8
07279fd9c4f48fff04dc2aba275f9ffc
2,400
PASSED
#include<bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template<typename T1, typename T2> istream& operator>>(istream& ins, pair<T1, T2>& v) { ins >> v.first >> v.second; return ins; } template<typename T, size_t N> istream& operator>>(istrea...
C++
f32b9d3b5c93e566e16c1de963a159a8
06a5e542e8305b1d497ab03176b74950
2,400
PASSED
#include<bits/stdc++.h> using namespace std; template<typename T1, typename T2> istream& operator>>(istream& ins, pair<T1, T2>& v) { ins >> v.first >> v.second; return ins; } template<typename T, size_t N> istream& operator>>(istream& ins, array<T, N>& v) { for (int i = 0; i < int(N); i++) cin >>...
C++
f32b9d3b5c93e566e16c1de963a159a8
da0215cc44ed420d366a3966c4fadf2c
2,400
PASSED
#include <bits/stdc++.h> #define X first #define Y second #define _ << " " << #define debug(x) #x << " = " << x #define ll long long #define ull unsigned long long #define all(v) v.begin(), v.end() #define sz(v) ((int)(v).size()) using pii = std::pair<int, int>; using pll = std::pair<ll, ll>; const ll maxn = 2e5+10...
C++
f32b9d3b5c93e566e16c1de963a159a8
9153e34e74cbe0b8c77818f64e9212f2
2,400
PASSED
/** it's fun! **/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/numeric> #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define o_0 cin.tie(0),ios::sync_with_stdio(0),cout.tie(); #define all(...
C++
f32b9d3b5c93e566e16c1de963a159a8
2bfbdfc0892f6cc2b39def974f1114d5
2,400
PASSED
/** it's fun! **/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/numeric> #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define o_0 cin.tie(0),ios::sync_with_stdio(0),cout.tie(); #define all(...
C++
f32b9d3b5c93e566e16c1de963a159a8
bc3ba2f39e4f2ecd22cffff0f775d1dc
2,400
PASSED
/** it's fun! **/ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/numeric> #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define o_0 cin.tie(0),ios::sync_with_stdio(0),cout.tie(); #define all(...
C++
f32b9d3b5c93e566e16c1de963a159a8
3463564b54f41ec6408b21622464281b
2,400
PASSED
#include <bits/stdc++.h> #define debug(X) { auto _X = (X); cout << "L" << __LINE__ << ": " << #X << " = " << (_X) << endl; } #define pr(A, a, b) { cout << "L" << __LINE__ << ": " << #A << " = "; for(int i = (a); i <= (b); i ++) cout << A[i] << ' '; cout << endl; } #define enter {cout << endl;} using namespace std; usin...
C++
c8747882ea0a79c0f821a6b9badd2625
83001fb1ef329d47d8bb507254e3984b
2,100
PASSED
#include <bits/stdc++.h> #define INT long long #define x first #define y second using namespace std; const int NN = 100100; int a[NN]; INT s[NN], x[NN]; vector<int> vec; typedef pair<int, int> pi; pi calc(int l, int r) { pi p; INT mx = s[r] - s[l - 1] - (x[r]^x[l - 1]); int st = lower_bound(vec.begin(), vec.end(), l...
C++
c8747882ea0a79c0f821a6b9badd2625
3d4640358798ffe3399236e16826784c
2,100
PASSED
#include<bits/stdc++.h> #define INT long long using namespace std; const int NN = 2e5 + 10; int A[NN],B[NN]; char str[NN]; vector<int > vec; INT pre[NN]; INT s[NN]; INT calc(int l,int r){ return pre[r] - pre[l - 1] - (s[r] ^ s[l - 1]); } int main(){ #ifndef ONLINE_JUDGE freopen("in.in","r",stdin); freopen("out.out",...
C++
c8747882ea0a79c0f821a6b9badd2625
241f9086ca6f193548aa5425f8737c7f
2,100
PASSED
#include<bits/stdc++.h> #define NN 200100 #define INT long long #define pii pair <int , int> using namespace std; int a[NN],b[NN],id[NN]; INT sum[NN],xr[NN]; int cnt(int l, int r){ return (id[r] - id[l]); } INT calc(int l, int r){ return (sum[r]-sum[l-1] - (xr[r]^xr[l-1])); } pii ans(int L, int R,INT val){ int l = ...
C++
c8747882ea0a79c0f821a6b9badd2625
c11772b43de327a4bb1b5defc45a0d17
2,100
PASSED
#include <bits/stdc++.h> #define INT long long using namespace std; const int NN = 1e5 + 100; int a[NN]; vector <int> vec; INT sum[NN]; int s[NN]; INT calc(int l, int r) { return (sum[r] - sum[l - 1] - (s[r] ^ s[l - 1])); } int main(){ #ifndef ONLINE_JUDGE freopen("in.in", "r", stdin); freopen("out.out", "w", s...
C++
c8747882ea0a79c0f821a6b9badd2625
47a42e61ea501a65dca0014a80bf7bd4
2,100
PASSED
#include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define db double #define int long long #define PII pair<int,int > #define mem(a,b) memset(a,b,sizeof(a)) #define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); using namespace std; const int mod = 1e9+7,inf = 1e18...
C++
c8747882ea0a79c0f821a6b9badd2625
badd89c4d92855d4ebbb17337ead1a56
2,100
PASSED
#include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define db double #define int long long #define PII pair<int,int > #define mem(a,b) memset(a,b,sizeof(a)) #define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); using namespace std; const int mod = 1e9+7,inf = 1e18...
C++
c8747882ea0a79c0f821a6b9badd2625
c02fc79c752913c887d6a95ef21ec7a6
2,100
PASSED
#include<bits/stdc++.h> #define N 100010 #define ll long long using namespace std; inline int read() { int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-') f=-1; ch=getchar(); } while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+(ch^'0'); ch=getchar(); } return x*f; } ...
C++
c8747882ea0a79c0f821a6b9badd2625
8392bb0baac2b6e29d8ef6902679254a
2,100
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; int n,q; ll a[1000001]; ll s[1000001]; ll x[1000001],mn,mx,tn; int t,pre[1000001],nxt[1000001]; int l,r; ll f(int l,int r){ if(l>r) return 1e18; return (s[r]-s[l-1])-(x[r]^x[l-1]); } int main(){ cin.tie(0); cout.tie(0); ios::sync_wi...
C++
c8747882ea0a79c0f821a6b9badd2625
6c2493473589f5252ae05aede10034c2
2,100
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; int n,q; ll a[1000001]; ll s[1000001]; ll x[1000001],mn,mx,tn; int t,pre[1000001],nxt[1000001]; int l,r; ll f(int l,int r){ if(l>r) return 1e18; return (s[r]-s[l-1])-(x[r]^x[l-1]); } int main(){ cin.tie(0); cout.tie(0); ios::sync_wi...
C++
c8747882ea0a79c0f821a6b9badd2625
5923c9355123a5e802ccb2a87495f14a
2,100
PASSED
#include<iostream> #include<map> #include<set> #define int long long using namespace std; map<int,int> mp,st; int q; signed main() { scanf("%lld",&q); while(q--) { char op; int t; scanf("\n%c%lld",&op,&t); if(op=='+')st[t]=1; else { if(!mp[t])mp[t]=t; while(st.count(mp[t]))mp[t]+...
C++
7b394dbced93130f83d61f7e325a980a
2c68414bda627a8c6ac5200063a891aa
1,500
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; int q; map<ll,ll>v,ans; int main() { cin>>q; while(q--) { char op; ll x; cin>>op>>x; if(op=='+')v[x]=1; else { if(!ans[x])ans[x]=x; while(v.count(ans[x]))ans[x]+=x; cout<<ans[x]<<'\n'; } } return 0; }
C++
7b394dbced93130f83d61f7e325a980a
484b856eb1ead34832c0759a7ddacedf
1,500
PASSED
#include<iostream> #include<cstring> #include<map> using namespace std; typedef unsigned long long ull; typedef long long ll; map<ll,int>mp; int q; int main() { cin>>q; char ch; ull x; while(q--) { scanf(" %c",&ch); scanf("%lld",&x); if(ch == '+') mp[x]=2; else { if(mp.count(x)) ...
C++
7b394dbced93130f83d61f7e325a980a
b83f7baa6e20e74b1a3e7f787f40af11
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define ull unsigned long long #define inf 0x3f3f3f3f #define INF 0x7fffffffffffffff #define R 0.57721566490153286060651209 #define lowbit(x) x&(-x) void read(int &re) { re=0;int f=1;char str=getchar(); while(str<'0'||str>...
C++
7b394dbced93130f83d61f7e325a980a
b74d27cbf4b93893fc424cf8d9a47ba9
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define ull unsigned long long #define inf 0x3f3f3f3f #define INF 0x7fffffffffffffff #define R 0.57721566490153286060651209 #define lowbit(x) x&(-x) void read(int &re) { re=0;int f=1;char str=getchar(); while(str<'0'||str>...
C++
7b394dbced93130f83d61f7e325a980a
48b41eadf4580c15d05c89afab415533
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define ull unsigned long long #define inf 0x3f3f3f3f #define INF 0x7fffffffffffffff #define R 0.57721566490153286060651209 #define lowbit(x) x&(-x) void read(int &re) { re=0;int f=1;char str=getchar(); while(str<'0'||str>...
C++
7b394dbced93130f83d61f7e325a980a
3b10b6c79069849c8685835bed6b5ee0
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long void solv() { int q; cin >> q; set<ll> s; s.insert(0); map<ll, ll> m_before; while (q--) { char c; cin >> c; if (c == '+') { ll x; cin >> x; ...
C++
7b394dbced93130f83d61f7e325a980a
06167a277816c5ca861e5cd06a7ca07a
1,500
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solv() { int q; cin >> q; set<ll> s; s.insert(0); map<ll, ll> m_before; while (q--) { char c; cin >> c; if (c == '+') { ll x; cin >> x; ...
C++
7b394dbced93130f83d61f7e325a980a
f2f19986ccdf975e6d883b8fa605d475
1,500
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solv() { int q; cin >> q; set<ll> s; s.insert(0); map<ll, ll> m_before; while (q--) { char c; cin >> c; if (c == '+') { ll x; cin >> x; ...
C++
7b394dbced93130f83d61f7e325a980a
53a09621718a0548cba8eafa65f391ac
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long void solv() { int q; cin >> q; set<ll> s; s.insert(0); map<ll, ll> m_before; while (q--) { char c; cin >> c; if (c == '+') { ll x; cin >> x; ...
C++
7b394dbced93130f83d61f7e325a980a
6d99b7956e978a0cdbf4256f3757e8db
1,500
PASSED
#include"bits/stdc++.h" #define N 1000005 #define M 55 #define int long long using namespace std; int read() { int x = 0, fff = 1; char c; while ((c = getchar()) < '0' || c > '9') if (c == '-') fff = -1; while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return x *...
C++
a16febf3b002638f78ba5a32f4b4c4d8
7139879f49f9a1331e758eea8c665448
1,800
PASSED