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 |
|---|---|---|---|---|---|
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef com... | C++ | 3a3977962de377beb94988d517d09f9c | eb4721c47fbbb44683b783351a278e92 | 3,200 | PASSED |
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef com... | C++ | 3a3977962de377beb94988d517d09f9c | e3e21f12b28ddbbd3cc6e9d0dee39585 | 3,200 | PASSED |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<vector>
#include<ctime>
#include<cstring>
#include<map>
#include<cmath>
#include<queue>
#define mp make_pair
#define PII pair<int,int>
#define fi first
#define se second
#define pb push_back
#define int long long
using namesp... | C++ | 3a3977962de377beb94988d517d09f9c | fc629f7229de4ced0e0a32ed007d7e75 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solution() {
int n;
cin >> n;
vector<int64_t> h(n);
for (int i = 0; i < n; ++i) {
cin >> h[i];
}
vector<int64_t> left(n + 1), right(n + 1);
for (int i = 0; i < n; ++i) {
int64_t mn = h[i];
for (int j = i... | C++ | 3a3977962de377beb94988d517d09f9c | 10b8ad25e60960f66b513749b879b907 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solution() {
int n;
cin >> n;
vector<int64_t> h(n);
for (int i = 0; i < n; ++i) {
cin >> h[i];
}
vector<int64_t> left(n + 1), right(n + 1);
for (int i = 0; i < n; ++i) {
int64_t mn = h[i];
for (int j = i... | C++ | 3a3977962de377beb94988d517d09f9c | dba5684bdc24b6744d5bfe9c249633da | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solution() {
int n;
cin >> n;
vector<int64_t> h(n);
for (int i = 0; i < n; ++i) {
cin >> h[i];
}
vector<int64_t> left(n + 1), right(n + 1);
for (int i = 0; i < n; ++i) {
int64_t mn = h[i];
for (int j = i... | C++ | 3a3977962de377beb94988d517d09f9c | d80b33e729fe6bfc845902f60d1c2bd5 | 3,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solution() {
int n;
cin >> n;
vector<int64_t> h(n);
for (int i = 0; i < n; ++i) {
cin >> h[i];
}
vector<int64_t> left(n + 1), right(n + 1);
for (int i = 0; i < n; ++i) {
int64_t mn = h[i];
for (int j = i... | C++ | 3a3977962de377beb94988d517d09f9c | a18c338be93702705417930228cb68ad | 3,200 | PASSED |
#include<bits/stdc++.h>
template <typename _Tp>void read(_Tp &x){
char ch(getchar());bool f(false);while(!isdigit(ch))f|=ch==45,ch=getchar();
x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
if(f)x=-x;
}
template <typename _Tp,typename... Args>void read(_Tp &t,Args &...args){read(t);read(arg... | C++ | 3a3977962de377beb94988d517d09f9c | b903731deb02a47be8c9e7e6ee7b0c7f | 3,200 | PASSED |
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,sse4.2,bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
using namespace std;
struct Rect {
int l;
int r;
int64_t h;
};
int64_t Area(Rect a) {
return a.h * (a.r - a.l + 1);
}
int64_t CommonArea(Rect a, Rect b) {
if (a.l >... | C++ | 3a3977962de377beb94988d517d09f9c | c25f6cfd941f735d088e8ede36eb3da9 | 3,200 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5+42;
ll b[N];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int k =0;
ll sum = 0;
for(int i=0; i<n+2; ... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | fccf0946467f9fc0cfdd48049ec81a32 | 1,200 | PASSED |
#pragma region head
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | cb20d639ad4101580d19768cd1067547 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
long long a[200010];
long long sum=0;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
n+=2;
sum=0;
int flag=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
sum+=a[i];
}
sort(a,a+n);
sum-=(a[n-1]+a[n-2]);
if(sum==a[n-1]||sum==a[n-2])
{
for(in... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | 179c27bf544a26d96f5e0f957e3cc2b4 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
long long a[N];
long long ans[N];
inline void solve(){
int n;
cin>>n;
for(int i=1;i<=n+2;i++) cin>>a[i];
sort(a+1,a+n+3,less<long long>());
long long sum=0;
for(int i=1;i<=n+1;i++)
sum+=a[i];
for(int i=1;i<=n+1;i++)
... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | a653492b67e38683a6ec395b55df8f58 | 1,200 | PASSED |
/*
_______________________________________________________________________________________
| |+| |++-++| ^ |++-++\ |+| |+| |+| |+| |+| |++---++| |
| |+| |+| /^\ |+| |+| |+|\ |+| |+| |+|\ |+| |+| |
| |+| |+|____ /+ +\ |+|/+/ |+... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | 25d732eb3227abf5b2898631b806163a | 1,200 | PASSED |
#include<stdio.h>
#include<algorithm>
#define N 200010
using namespace std;
long long b[N];
long long qiuhe(int n)
{
long long sum = 0;
for(int i=0; i<n; i++)
sum+=b[i];
return sum;
}
int main(void)
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
long long sum = 0,sum1 = 0,sum2;
scanf("%d",&n);
for(... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | ab262b01cc2a318dff88d36dd28ad56a | 1,200 | PASSED |
#include<stdio.h>
#include<algorithm>
#define N 200010
using namespace std;
long long b[N];
int main(void)
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
long long sum = 0,sum1 = 0,sum2;
scanf("%d",&n);
for(int i=0; i<n+2; i++)
scanf("%lld",&b[i]);
sort(b,b+n+2);
for(int i=0; i<n; i++)
sum+=b[... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | 13df939baf99de54a91b3b0ad78a9aed | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[200005];
int main()
{
int t,i,j,k,l,n;
scanf("%d",&t);
while (t--)
{
scanf("%d",&n);
for(i=0;i<n+2;i++)
scanf("%lld",a+i);
sort(a,a+n+2);
ll sum=0;
for(i=0;i<n;i++)
sum+=a[i];
if (sum==a[n] || sum==a[n+1])
{
for(i=0;i<n;i++... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | 9dca77faaaedd6badf67960c490919fe | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#include<map>
typedef long long ll;
map<ll,ll>b;
ll a[1010000];
int main(){
ll t,n,i;
scanf("%lld",&t);
while(t--){
scanf("%lld",&n);
ll ans=0,j=-1;
//memset(b,0,sizeof(b));
for(i=0;i<n+2;i++){
scanf("%lld",&a[i]);
b[a[i]]=1;
}
sort(a,a+n+2);
b[a... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | ad77e9b640e8f3c1dac2772f74fd6fe5 | 1,200 | PASSED |
#include<stdio.h>
#include<string.h>
#include<map>
#include<algorithm>
using namespace std;
long long b[200010];
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
map<long long,int>mp;
int n;
scanf("%d",&n);
long long sum=0;
for(int i=1; i<=n+2; i++)
{
... | C++ | ce667a8fb60841c994aebedb35a3b0d8 | 78fec52c846afab0822706dec2b71a25 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
struct node {
int x,y;
}s[3],ans[3];
void solve()
{
int num[9],na[200010],k=0;num[0]=0;num[1]=0;
int a,b;cin>>a>>b;
na[0]=num[0]=a;na[1]=num[1]=b;
int n=a+b;
string s;cin>>s;
if(n%2==0&&(a%2==1||b%2==1)){cout<<-1<<endl;return;}
else if(n%2==1)
{
if(s[n/2]=='?')
... | C++ | 001ac8bce4e44e9266a13eb27760906c | ee1b049aed3acfa589b1e27e53d810ce | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
string s;
int n,a,b,t;
int main(){
cin>>t;
while(t--){
cin>>a>>b>>s,n=a+b;
bool ok=1;
for(int i=0;i<n;i++)if(s[i]!='?'){
if(s[n-i-1]!='?')ok&=s[i]==s[n-i-1];
else s[n-i-1]=s[i];
}
a-=(int)count(s.begin(),s.end(),'0'),b-=(int)count(s.begin(),s.end(),'1');
... | C++ | 001ac8bce4e44e9266a13eb27760906c | ccb80339a41b2898a04ea177dd936b15 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
void solve(){
int a,b,n;
string s;
cin>>a>>b>>s;
n=a+b;
for(int i=0;i<n;i++)
if(s[i]=='?'&&s[n-i-1]!='?') s[i]=s[n-i-1];
a-=count(s.begin(),s.end(),'0');
b-=count(s.begin(),s.end(),'1');
if(n%2==1&&s[n/2]=='?'){
if(a%2==1) a--,s[n/2]='0';
else b--,s[n/2]='1';
... | C++ | 001ac8bce4e44e9266a13eb27760906c | 7920436ea607b204b83a168f2698c8f9 | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int _;
cin >> _;
while (_--) {
int a, b, n;
string s;
cin >> a >> b >> s;
n = s.length();
for (int i = 0; i < n; i++) {
if (... | C++ | 001ac8bce4e44e9266a13eb27760906c | 6cf882f4e4fe19b61c2889265d33838e | 1,200 | PASSED |
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<queue>
#include<map>
#include<vector>
#include<stack>
#include<set>
#include<deque>
#include <sstream>
//#include <string>
//#include <unordered_map>
#define x first
#define y second
#define ios ios::sync_with_stdio(false),cin.tie(0),cou... | C++ | 001ac8bce4e44e9266a13eb27760906c | 4cc9eacaa3bfdd3a9a7f77d77966ea4e | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define co cout
#define ci cin
#define sf1(n) scanf("%lld",&n)
#define sf2(n,m) scanf("%lld %lld",&n,&m)
#define sf3(n,m,p) scanf("%lld %lld %lld",&n,&m,&p)
#define pf1(n) printf("%lld\n",n)
#define mem(a,b) memset... | C++ | 001ac8bce4e44e9266a13eb27760906c | 676c50404fe4b3eed8feb2b41c2df91f | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main () {
ios::sync_with_stdio(false);
int t;
cin>>t;
while(t--){
int a,b,wenhao=0;
string s;
cin>>a>>b>>s;
if(a+b!=s.length()){cout<<"-1\n";continue;}
int pd=0;
for(int i=0;i<s.length();i++)
if(... | C++ | 001ac8bce4e44e9266a13eb27760906c | 1d062e6be53d8ed48faa83a4e0d7f1a7 | 1,200 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int maxn = 4e5 + 10;
int a, b;
char s[maxn];
int main()
{
int t;
scanf("%d", &t);
while(t--)
{
scanf("%d%d%s", &a, &b, s + 1);
int n = a + b;
int fla... | C++ | 001ac8bce4e44e9266a13eb27760906c | ca43eb74fa8be41298c0bf4d978228a4 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 500005;
int main(){
int t;
int a,b;
int sum=0;
char s[N];
scanf("%d",&t);
while(t--){
int f=0;
scanf("%d %d",&a,&b);
getchar();
gets(s);
sum=a+b;
for(int i=0;i<sum;i++){
if(s[i]=='0'){
a--;
}
if(s[i]=='1'){
b--;
}
}
... | C++ | 001ac8bce4e44e9266a13eb27760906c | 3794f3edc42fedba9ce54b4c8c5fd987 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int coun(string s,char c){
int ans=0;
for(int i=0;i<s.size();i++) if(s[i]==c) ans++;
return ans;
}
void solve(){
int a,b,l;
string s;
s.clear();
scanf("%d%d\n",&a,&b);
getline(cin,s);
l=s.size();
for(int i=0;i<l;i++){
if(s[i]=='?'&&s[l-i-1]!='?') s[i]=s[l-i-1];
... | C++ | 001ac8bce4e44e9266a13eb27760906c | 955085cc4b3127bc2f07a17c1deda8b8 | 1,200 | PASSED |
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#define debug1 cout << "wocao" << endl;
#define debug(x) cout << #x << ':' ... | C++ | d8fb3822b983b8a8ffab341aee74f56f | b06cfc8c82505cdfe52dac1079cd7fde | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
pair<int,int> p[2];
int n, x=0, k=0;
int a[500][500]={0};
char m;
scanf("%d ", &n);
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
scanf("%c", &m);
if(j==n-1)
getchar();
if(m=='*')
{
a... | C++ | d8fb3822b983b8a8ffab341aee74f56f | dc93a4145eb050df39aeefb42f067f7c | 800 | PASSED |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
const int N = 404;
string s[N];
int main(){
int t;
cin >> t;
while(t--){
int n, x1 = 0, y1 = 0, x2 = 0, y2 = 0, st = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++){
cin >> s[i];
... | C++ | d8fb3822b983b8a8ffab341aee74f56f | 874e4038a055f5c6d8faadebcacbcc59 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int N[2000][2000];
int main()
{
int t;
cin >> t;
while (t--)
{
vector<int> x, y;
int n;
cin >> n;
char ch;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cin >> ch;
if (ch == '.')
{
N[i][j] = 0;
}
else
{
N... | C++ | d8fb3822b983b8a8ffab341aee74f56f | 37a5540a659c50db1c0a405d39c69ece | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int x1 = 0,x2 = 0,y1 = 0,y2 = 0,k = 0,k1 = 0;
int n;
cin >> n;
char a[n+1][n+1];
for(int i = 1;i <= n;i++){
for(int j = 1;j <= n;j++){
cin >> a[i][j];
... | C++ | d8fb3822b983b8a8ffab341aee74f56f | 06a32d0caf5949756b89735c931e9378 | 800 | PASSED |
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
char a[500][500];
int i,j,n,x[3],y[3],p;
p=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s",a[i]);
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
if(a[i][j]=='*')
{
x[p]=j;
y[p]=i;
p++;
}
}
if(x[0]==x[1])
{
if(x[0]... | C++ | d8fb3822b983b8a8ffab341aee74f56f | ba31163be91d273e66605806b81fc903 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
const int N=405;
char s[N][N];
int x[2],y[2];
int t,n;
bool judge(int x,int y){
if(x>=0&&x<n&&y>=0&&y<n)return true;
return false;
}
int main(){
cin>>t;
while(t--) {
cin >> n;
for (int i = 0; i < n; i++) {
fo... | C++ | d8fb3822b983b8a8ffab341aee74f56f | f3f586aaf809e7d1f34c89038913fa7c | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
char s[410][410];
int main()
{
int t,n;
cin>>t;
while(t--){
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cin>>s[i][j];
}
}
int k=0,h=0,x=0,y=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(s[i][j]=='*'){
k=i,h=j;
}
else... | C++ | d8fb3822b983b8a8ffab341aee74f56f | 47f240edcf79217f92c58281bb70855e | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
char s[405][405];
int main(){
int n,m;
cin>>n;
while(n--){
cin>>m;
getchar();
int x1,y1,x2,y2,flag=0;
for(int i=1;i<=m;i++){
for(int j=1;j<=m;j++){
cin>>s[i][j];
if(s[i][j]=='*'){
if(flag==0){
x1=i;
y1=j;
flag=1;
}
else{... | C++ | d8fb3822b983b8a8ffab341aee74f56f | f6ec7e6bea2c05f73193cc013addc94c | 800 | PASSED |
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char a[1000][1000];
int book[1000],vis[1000];
int main()
{
int t,n,ans,i,j,k,s1,s2;
scanf("%d",&t);
while(t--)
{
memset(a,0,sizeof(a));
memset(vis,0,sizeof(vis));
memset(book,0,sizeof(book));
scanf("%d",&n);
ans=0;
for(i=0;i... | C++ | d8fb3822b983b8a8ffab341aee74f56f | cffdb83ab21d0e871c9a1390e5852295 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int main()
{
int T;
cin >> T;
while (T--)
{
int n, l, r, s;
cin >> n >> l >> r >> s;
int len = r - l + 1;
if (s < (1 + len) * len / 2 || s > (n + n - len + 1) * len / 2) puts("-1");
else
... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | bbc4a676a13afd5044853f375b3bab4e | 1,600 | PASSED |
#include<bits/stdc++.h>
#define N 505
using namespace std ;
int T,n,l,r,s,a[N] ;
bool vis[N] ;
int main()
{
scanf("%d",&T) ;
while(T--)
{
scanf("%d%d%d%d",&n,&l,&r,&s) ;
int len=r-l+1,t=len ;
if(s<len*(len+1)/2)
{
printf("-1\n") ;
continue ;
}
memset(a,0,sizeof(a)) ;
memset(vis,0,sizeof(vis)) ;
... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | a9eb83f838faff4ffa117ebaa40d5d41 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
void solve(){
int n, l, r, s;
cin >> n >> l >> r >> s;
int sum = 0, tmp = n;
for (int i=l; i<=r; i++) {
sum += tmp;
tmp--;
}
if (sum<s){
cout << -1;
return;
}
vector<int> per(n+5);
bool chosen[n+5];
... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | 2787ca75daf014c038b6123ca7bd660e | 1,600 | PASSED |
#include <bits/stdc++.h>
#define pii pair<int,int>
using namespace std;
typedef long long ll;
int t, n, l, r, s;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>> t;
while(t--)
{
cin>> n >> l >> r >> s;
int m = r-l+1;
int k = m*(m+1) / 2;
if(s < k || s > m*(n-m) + k)
{
cout << ... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | 9baa9dc68b5afed12186ad055b9eebd5 | 1,600 | PASSED |
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int t;
cin >> t;
while (t--) {
int n, l, r, s;
cin >> n >> l >> r >> s;
ll a = (1 + r - l + 1) * (r - l + 1) / 2;//区间最小值;
ll b = (n + n - r + l) *... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | ba087688a7ff993bcc8f349c1eba5b2e | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
signed main()
{
int t;
cin >> t;
while (t--)
{
set<int> cnt;
int a[600] = { 0 };
int n, l, r, s;
cin >> n >> l >> r >> s;
int len = r - l+1;
int maxn = 0; int minn = 0;
minn = len + (len * (len - 1)) / 2;
maxn =... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | a1384e2f4091ad9f51521cb23cc5e72b | 1,600 | PASSED |
#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#define FREOPEN freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)
#else
#define debug(...) 0
#define FREOPEN 0
#endif
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = a;... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | c8988da03a1c8b6e260a84e240405512 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=505;
int a[maxn];
bool vis[maxn];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int t;cin>>t;
while(t--){
memset(vis,0,sizeof vis);
memset(a,0,sizeof a);
int n,l,r,s;
cin>>n>>l>>r>>s;
... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | 8bb001cdf79b1a56d6ee727249b3d757 | 1,600 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
int a[505],ban[505];
int main()
{
int i,j,k,n,m,x,y,l,r,s,ii,t;
scanf("%d",&t);
for(ii=1;ii<=t;ii++)
{
memset(ban,0,sizeof(ban));
memset(a,0,sizeof(a));
scanf("%d%d%d%d",&n,&l,&r,&s);
x=r-l+1;
if... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | bf55cbe46ef1ebbc9045bdc335dfded0 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fora(i,fi,ed) for(int i=fi;i<ed;i++)
#define in insert
typedef long long ll;
typedef vector<int> vi;
const int INF=0x3f3f3f3f;
const int maxn=500+5;
int ans[maxn];
int vis[maxn];
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0);
... | C++ | 88c8376ad65c5c932c15dc09d6c4d75f | d29d9cc441269df762c79523acb12d95 | 1,600 | PASSED |
#include <iostream>
#include <array>
#include <set>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
const int KNOWN = 32;
const int BUF_SIZE = 10739;
array<int, INF> sieve;
set<int> known;
array<int, BUF_SIZE> buf;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
... | C++ | b5dcee7034ee2742b666aea4cbfc616f | d477d309053303d965e306a2061c7552 | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <set>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
const int KNOWN = 42;
const int BUF_SIZE = 12478;
array<int, INF> sieve;
set<int> known;
array<int, BUF_SIZE> buf;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
... | C++ | b5dcee7034ee2742b666aea4cbfc616f | b74a6f49952a66cf6b002ce3e9f8172b | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <set>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
const int KNOWN = 72;
const int BUF_SIZE = 16917;
array<int, INF> sieve;
set<int> known;
array<int, BUF_SIZE> buf;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
... | C++ | b5dcee7034ee2742b666aea4cbfc616f | 1647867593b8c450b84d41036f2c3d6a | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <set>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
const int KNOWN = 108;
const int BUF_SIZE = 18582;
array<int, INF> sieve;
set<int> known;
array<int, BUF_SIZE> buf;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
... | C++ | b5dcee7034ee2742b666aea4cbfc616f | e951b80d2628fc8849c611e7735ef6de | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
const int KNOWN = 32;
const int KNOWN_SIZE = 48366;
array<int, INF> sieve;
array<int, KNOWN_SIZE> known;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
in... | C++ | b5dcee7034ee2742b666aea4cbfc616f | a85ad264a5520ba40bec766d883afb60 | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
array<int, INF> sieve;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
for (long long p = 2; p < INF; ++p) {
if (!sieve[p]) {
/* p is ... | C++ | b5dcee7034ee2742b666aea4cbfc616f | a24e6d801425cef0fd8dcc08d4128773 | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
array<int, INF> sieve;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
for (long long p = 2; p < INF; ++p) {
if (!sieve[p]) {
/* p is ... | C++ | b5dcee7034ee2742b666aea4cbfc616f | e9af6c408ca890e33079853892ccfa5a | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10'000'001;
array<int, INF> sieve;
void init_primes() {
sieve.fill(0);
sieve[1] = 1;
for (long long p = 2; p < INF; ++p) {
if (sieve[p] < p) {
if (!... | C++ | b5dcee7034ee2742b666aea4cbfc616f | 876a63aaa444f8f4521043b8e28dbe8d | 1,700 | PASSED |
#include <iostream>
#include <array>
#include <unordered_map>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10 * 1000 * 1000;
const int MAX_PRIME = 8192;
const int PRIMES_NUM = 1028;
array<bool, MAX_PRIME> sieve;
array<int, PRIMES_NUM> primes;
unordered_map<int, int> cache;
void init_... | C++ | b5dcee7034ee2742b666aea4cbfc616f | d7c4f434c89bdc1840641404dc951788 | 1,700 | PASSED |
#include <iostream>
#include <array>
using namespace std;
int ri() { int x; cin >> x; return x; }
const int INF = 10 * 1000 * 1000;
const int MAX_PRIME = 8192;
const int PRIMES_NUM = 1028;
array<bool, MAX_PRIME> sieve;
array<int, PRIMES_NUM> primes;
void init_primes() {
sieve.fill(true);
sieve[0] = sieve[1]... | C++ | b5dcee7034ee2742b666aea4cbfc616f | 18e92033a46edb194f87dfca109815ca | 1,700 | 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;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
#define vi vector<int>
#define vvi vec... | C++ | 1c154d858ded80a1c36febd6178fc1fe | 83f5576b875c809306a2537cba2496db | 1,900 | 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;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
#define vi vector<int>
#define vvi vec... | C++ | 1c154d858ded80a1c36febd6178fc1fe | 7cc1a0ca1c9e86ae1b2cc08eabbb49a4 | 1,900 | PASSED |
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <queue>
#include <utility>
#include <stack>
#define mes memset
#define mec memcpy
using namespace std;
typedef long long ll;
typedef pair<int,int>PII;
const int N = 200010;
const int null = 0x3f3... | C++ | 1c154d858ded80a1c36febd6178fc1fe | d77b261bfc1d25bf61ec939f30371ff2 | 1,900 | PASSED |
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <queue>
#include <utility>
#include <stack>
#define mes memset
#define mec memcpy
using namespace std;
typedef long long ll;
typedef pair<int,int>PII;
const int N = 200010;
const int null = 0x3f3... | C++ | 1c154d858ded80a1c36febd6178fc1fe | 5a8bb0acf1ec7fab1b43e0d782131714 | 1,900 | PASSED |
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <queue>
#include <utility>
#include <stack>
#define mes memset
#define mec memcpy
using namespace std;
typedef long long ll;
typedef pair<int,int>PII;
const int N = 200010;
const int null = 0x3f3... | C++ | 1c154d858ded80a1c36febd6178fc1fe | 9bdb0eae7f2e2be9b79b56e3a9c1cddd | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define N 200050
#define ll long long
ll a[N], b[N];
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int _;
cin >> _;
while (_--) {
int n, c;
ll r = 0x3fffffff, day = 0, m = 0, t;
cin >> n >>... | C++ | 1c154d858ded80a1c36febd6178fc1fe | f2ed102b1e53165c09a4d29021d822b7 | 1,900 | 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;
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://x...content-available-to-author-only...i.it/splitmix64.c
x += 0x9e3779b97f4a... | C++ | 1c154d858ded80a1c36febd6178fc1fe | f695c4d260bd30f93e1ff9d92fab9095 | 1,900 | PASSED |
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
const int N=1e6+10;
typedef long long ll;
ll a[N],b[N];
int main()
{
int i,j,k,m,n,t;
cin>>t;
while(t--)
{
cin>>n>>k;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<n;i++)
cin>>b[i];
ll sum=0,ans=0x3f3f3f3f,d=0,tot=0,today=0;
... | C++ | 1c154d858ded80a1c36febd6178fc1fe | 384311740aa9ee04f378d560f42f039e | 1,900 | PASSED |
#include<bits/stdc++.h>
#define int long long
#define INF 0x3f3f3f3f
#define mod 998244353
#define endl '\n'
using namespace std;
typedef long long LL;
typedef pair<int, int>PII;
const int N = 200050;
int n, c;
int a[N], b[N];
void solve() {
cin >> n >> c;
for (int i = 1; i <= n; ++i)
cin >> a[i];
for (int i = ... | C++ | 1c154d858ded80a1c36febd6178fc1fe | 78bc0e3321cdf9a6eb2405a9e5430634 | 1,900 | PASSED |
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/rope>
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)a.size()
#define eq(a, b) (fabs(a - b) < EPS)
#define md(a, b) ((a) % b +... | C++ | 1c154d858ded80a1c36febd6178fc1fe | ac2b268b6a25b1b38537e9f26c742f37 | 1,900 | PASSED |
// another approach
#include<bits/stdc++.h>
//important dp question...
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
// dp[curr][k] represents when ball with energy 'k' is projected towards curr th wall
int dp[N][K];
int flag=0;
int solve(int curr, int k... | C++ | 9414b6420748f14fd84b44ddd12af68c | 912e3bf45446619eb93bb5ce6419a643 | 1,600 | PASSED |
#include<bits/stdc++.h>
//important dp question...
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
// dp[curr][k] represents when ball with energy 'k' is projected towards curr th wall
int dp[N][K];
int flag=0;
int solve(int curr, int k) {
if... | C++ | 9414b6420748f14fd84b44ddd12af68c | 8d9d283b60b7554e241920675b329659 | 1,600 | PASSED |
// another approach
#include<bits/stdc++.h>
//important dp question...
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
// dp[curr][k] represents when ball with energy 'k' is projected towards curr th wall
int dp[N][K];
int flag=0;
int solve(int curr, int k... | C++ | 9414b6420748f14fd84b44ddd12af68c | 9e741b0958b3339a44b8a8ceb5366882 | 1,600 | PASSED |
// another approach
#include<bits/stdc++.h>
//important dp question...
// implemented with recursion with memoization
// bettter and simple version at the end..
// this one is by the editorial..
// quite complex.. :/
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1... | C++ | 9414b6420748f14fd84b44ddd12af68c | 66c7c4f5c74f0f3035ae31199b11d528 | 1,600 | PASSED |
// another approach
#include<bits/stdc++.h>
//important dp question...
// implemented with recursion with memoization
// bettter and simple version at the end..
// this one is by the editorial..
// quite complex.. :/
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1... | C++ | 9414b6420748f14fd84b44ddd12af68c | a05aa22aee12d9137808408066989209 | 1,600 | PASSED |
#include<bits/stdc++.h>
//important dp question...
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
int dp[N][K][2];
int flag=0;
int solve(int curr, int k, int dir) {
if (k == 1) {
return 1;
}
if (dp[curr][k][dir] != -1) {
... | C++ | 9414b6420748f14fd84b44ddd12af68c | 9517ded6d554b599c8200dd67e87e1a4 | 1,600 | PASSED |
#include<bits/stdc++.h>
//important dp question...
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
int dp[N][K][2];
int flag=0;
int solve(int curr, int k, int dir) {
if (k == 1) {
return 1;
}
if (dp[curr][k][dir] != -1) {
... | C++ | 9414b6420748f14fd84b44ddd12af68c | d5728f9a6b40da14d763628e80218474 | 1,600 | PASSED |
#include<bits/stdc++.h>
//important dp question...
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
int dp[N][K][2];
int flag=0;
int solve(int curr, int k, int dir) {
if (k == 1) {
return 1;
}
if (dp[curr][k][dir] != -1) {
... | C++ | 9414b6420748f14fd84b44ddd12af68c | 00cc5875d0d342dedf9eb65d04cd63e3 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
int dp[N][K][2];
int solve(int curr, int k, int dir) {
if (k == 1) {
return 1;
}
if (dp[curr][k][dir] != -1) {
return dp[curr][k][dir];
}
... | C++ | 9414b6420748f14fd84b44ddd12af68c | cfd1a71c5067d81fbc5a61887f667373 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 1001;
const int K = 1001;
int n, k;
const int mod = 1e9 + 7;
int dp[N][K][2];
int solve(int curr, int k, int dir) {
if (k == 1) {
return 1;
}
if (dp[curr][k][dir] != -1) {
return dp[curr][k][dir];
}
... | C++ | 9414b6420748f14fd84b44ddd12af68c | 60e6ee70c7da50a71d1e8098c668dc9c | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
const int maxn=1e5+1;
const int K=41;
vector<vector<int>> tree(maxn), dp1(maxn,vector<int>(K)), dp2(maxn,vector<int>(K));
vector<int> ans(maxn), a(maxn);
int n,k;
void dfs1(int x, int p=-1){
for(int y:tree[x]){
if(y==p) continue;... | C++ | 02a0b3cb995f954b216130d703dfc856 | 61a784ea04f991e3f6e960cb6d0c6d7c | 2,500 | PASSED |
// This code wrote by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
#define ALL(x) (x).begin(),(x).end()
#define mem(x,y) memset(x,y,sizeof x)
#define sz(x) (int)(x).size()
#define ln putchar('\n')
#define lsp putchar(32)
#define pb push_back
#define MP std::make_pair
#ifdef _L... | C++ | 02a0b3cb995f954b216130d703dfc856 | 849edff1d38a3415e61e300eb623eec1 | 2,500 | PASSED |
// LUOGU_RID: 90606628
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k;
//dksfhksdhfklsdk;fklajdlkkfjasjkldvkmlksdjvlksdadf
int head[maxn * 2], ver[maxn * 2], Next[maxn * 2], tot;
struct node {
int num[21][2];
}f[maxn], d[maxn];
int a[maxn], v[maxn];
void add(int x, int y) {
... | C++ | 02a0b3cb995f954b216130d703dfc856 | c3f6cae7b2815835d13b325ce489bff1 | 2,500 | PASSED |
// LUOGU_RID: 90606167
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k;
// fkgjkdlfklsds
int head[maxn * 2], ver[maxn * 2], Next[maxn * 2], tot;
struct node {
int num[21][2];
}f[maxn], d[maxn];
int a[maxn], v[maxn];
void add(int x, int y) {
ver[++tot] = y, Next[tot] = head[... | C++ | 02a0b3cb995f954b216130d703dfc856 | 1b6520e9eb7b8b9b34dc390795f480dc | 2,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, k;
int head[maxn * 2], ver[maxn * 2], Next[maxn * 2], tot;
struct node {
int num[21][2];
}f[maxn], d[maxn];
int a[maxn], v[maxn];
void add(int x, int y) {
ver[++tot] = y, Next[tot] = head[x], head[x] = tot;
}
node merge(node x,... | C++ | 02a0b3cb995f954b216130d703dfc856 | 32dec57b9c14529c8db101d7cc39f3f9 | 2,500 | PASSED |
#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=b;i>=a;i--)
#define FOR(i,u) for(int i=head[u];i;i=e[i].next)
#define endl "\n"
int read()
{
int x;
scanf("%d",&x);
return x;
}
using namespace std;
const int N=2e5+5;
int dp[N][50],a[N],d... | C++ | 02a0b3cb995f954b216130d703dfc856 | d01da1d4e0231685d184a16a15750f1c | 2,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N=100005;
int n,k,head[N],nxt[N*2],ver[N*2],siz[N],dep[N],dfn[N],Ans[N],a[N];
int tot=0,sum=0,D[40],rk[N];
inline void add_edge(int x,int y){
++tot,nxt[tot]=head[x],head[x]=tot;
ver[tot]=y;
++tot,nxt[tot]=head[y],head[y]=tot;
ver[tot]=x;
return ;
}... | C++ | 02a0b3cb995f954b216130d703dfc856 | d5293ad67618251063fa4743d9e9ee4a | 2,500 | PASSED |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
... | C++ | 02a0b3cb995f954b216130d703dfc856 | 0170f87a79ba262d23baa6ad49cc21de | 2,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define reg register
const int maxn=10005;
char buffer[maxn],*S,*T;
inline char Get_Char(){
if(S==T){
T=(S=buffer)+fread(buffer,1,maxn,stdin);
if(S==T)return EOF;
}
return *S++;
}
inline in... | C++ | 02a0b3cb995f954b216130d703dfc856 | 30eb0c6562715f4cf86c3a13e610022e | 2,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define reg register
const int maxn=10005;
char buffer[maxn],*S,*T;
inline char Get_Char(){
if(S==T){
T=(S=buffer)+fread(buffer,1,maxn,stdin);
if(S==T)return EOF;
}
return *S++;
}
inline in... | C++ | 02a0b3cb995f954b216130d703dfc856 | 8727b920bfdac98d0ffa4a9ef1cf2349 | 2,500 | PASSED |
import math
import sys
def ceil(f,f1):
return (f+f1-1)//f1
def main():
n, m = map(int, sys.stdin.readline().split())
dp = [math.inf] * (m + 1)
dp[0] = 0
used = [0] * (m + 1)
used[0] = 1
for i in range(n):
t, x, y = map(int, sys.stdin.readline().split())
s ... | Python | a592b3cf7ecac3d56fe4e99e35d454f6 | 89db234b6a287feb13647d141e90091f | 2,200 | PASSED |
import os, sys
from io import BytesIO, IOBase
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from heapq import heappush, heappop
from functools import lru_cache
from itertools import accumulate
import math
import sys
# sys.setrecursionlimit(10 ** 6)
# Fast... | Python | a592b3cf7ecac3d56fe4e99e35d454f6 | 18992d6afdfda901100a023030d225c7 | 2,200 | PASSED |
import os,sys
from random import randint
from io import BytesIO, IOBase
from collections import defaultdict,deque,Counter
from bisect import bisect_left,bisect_right
from heapq import heappush,heappop
from functools import lru_cache
from itertools import accumulate
import math
# Fast IO Region
BUFSIZE = 8... | Python | a592b3cf7ecac3d56fe4e99e35d454f6 | 9ffc7835c3320de0fcbd735cd5c3c630 | 2,200 | PASSED |
import sys, os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
n, m = map(int, input().split())
ans = [-1] * m
inf = pow(10, 9) + 1
dp = [inf] * (m + 1)
dp[0] = 0
for i in range(1, n + 1):
t, x, y = map(int, input().split())
if t == 1:
z = x // 100000 + min(x % 100000, 1)
... | Python | a592b3cf7ecac3d56fe4e99e35d454f6 | 12e9a6505820cb4c23d55418b8a14d90 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = 1e9;
const ll line = 1e5;
ll myceil(ll a,ll b){
if(a%b == 0)
return a/b;
return a/b+1;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll q,n;
cin >> q >> n;
vector<ll> a(n+1,inf);... | C++ | a592b3cf7ecac3d56fe4e99e35d454f6 | 31c582d83afabb4ea281e1709502e754 | 2,200 | PASSED |
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair < int, int > PII;
#define all(x) x.begin(),x.end()
//#define int LL
//#define lc p*2+1
//#define rc p*2+2
#define endl '\n'
#define inf 0x3f3f3f3f
... | C++ | a592b3cf7ecac3d56fe4e99e35d454f6 | 4e0c20b5ba9c7ac81936c0d3d971a17e | 2,200 | PASSED |
/**
* author: ivanzuki
* created: Mon May 30 2022
**/
#include <bits/stdc++.h>
using namespace std;
long long Ceil(long long a, long long b) {
return (a + b - 1) / b;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> was(m + 1, -1);
... | C++ | a592b3cf7ecac3d56fe4e99e35d454f6 | 586974778eee2390085e2fcc0439d9e1 | 2,200 | PASSED |
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
//#include "temp.cpp"
#include <cstdio>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x) cerr << #x <<" "; print(x); cerr << endl;
#else
#define dbg(x)
#endif
#define sz(x) (int)x.size()
#define len(x) (int)x.length()
#define all(x) (x).... | C++ | a592b3cf7ecac3d56fe4e99e35d454f6 | d5a6d0b3f95852b1bb629645a54a4de4 | 2,200 | PASSED |
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
//#include "temp.cpp"
#include <cstdio>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x) cerr << #x <<" "; print(x); cerr << endl;
#else
#define dbg(x)
#endif
#define sz(x) (int)x.size()
#define len(x) (int)x.length()
#define all(x) (x).... | C++ | a592b3cf7ecac3d56fe4e99e35d454f6 | 44d3fbc9b64b51fe1869d4581faa95b4 | 2,200 | PASSED |
#include "bits/stdc++.h"
using namespace std;
#define rep(i, s, e) for (int i = (s) ; i < (e); ++i)
#define all(x) (x).begin(),(x).end()
#define x first
#define y second
#define pb push_back
#define sz(a) ((int)(a).size())
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef array<int,2> a... | C++ | a592b3cf7ecac3d56fe4e99e35d454f6 | c227df562970e9db6613c083811a347b | 2,200 | PASSED |
# Main
def main():
num_tests = int(input())
for i in range(num_tests):
# Get the number of blocks and the box width
n, w = map(int,input().split())
# Build the dictionary of blocks
# blocks = {}
# for i in list(map(int,input().split())):
# if i in... | Python | 49ba9921ae8b6bc53726e7a521eefe39 | fd305de81b695766a5fab7315172f590 | 1,300 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.