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 |
|---|---|---|---|---|---|
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#define fore(i,... | C++ | 92b6ab47c306a15631f045d624a1bf37 | 7d73b5a354d4661f5cf731fa303687e7 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 3e5;
int n, x;
ll a[MAXN], dp[MAXN+1][5];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n, x;
cin >> n >> x;
for(int i = 0; i < n; i++) {
cin >> a[i];
dp[i+1][0] = dp[i][0];
dp[i+1][1] = dp[i][1]+a[i... | C++ | 92b6ab47c306a15631f045d624a1bf37 | fa4de499de6de42f5f5bb4debce5d31f | 1,900 | PASSED |
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef pair<ld,ld> pld;
typ... | C++ | 92b6ab47c306a15631f045d624a1bf37 | fb711e46b1fe5569535e5f56ada3520d | 1,900 | PASSED |
#include <iostream>
using namespace std;
int n, x;
long long sol;
int v[300005];
long long dp[300005][3];
int main() {
cin >> n >> x;
for(int i = 1; i <= n; i++)
cin >> v[i];
for(int i = 1; i <= n; i++) {
dp[i][0] = v[i] + max(dp[i - 1][0], 0LL);
dp[i][1] = max(0LL, max(dp[i - 1][2], dp[i - 1][1])... | C++ | 92b6ab47c306a15631f045d624a1bf37 | 6a7b0c20268961c2168cbf7c60df4620 | 1,900 | PASSED |
#include <bits/stdc++.h>
#define TASK "something"
#define int long long
using namespace std;
const int N = 3e5 + 5;
int n, a[N], s[N], x;
int Left[N], Right[N];
int last_solve() {
for (int i = 1; i <= n; i++)
s[i] = s[i-1] + a[i];
int smin = 0;
for (int i = 1; i <= n; i++) {
smin = min (s[i], smin);
Left[i] ... | C++ | 92b6ab47c306a15631f045d624a1bf37 | 7e4484de1065f73288be271ecb0dce85 | 1,900 | PASSED |
#include<bits/stdc++.h>
#define ll long long int
#define IOS cin.tie(NULL);cout.tie(NULL)
#define F first
#define S second
#define pb push_back
using namespace std;
int main() {
IOS;
ll n,k,x,temp=0,max=0,ans=0,size=0,flag=0,temp1=0,min=0;
cin>>n>>k;
ll arr[n]={0},arrcum[n]={0};
if(k>0) {
for(ll i=0; i<n; i++) ... | C++ | 92b6ab47c306a15631f045d624a1bf37 | 714bf3c0056da97693098e63ee3d30cb | 1,900 | PASSED |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll mod= 1e9+7;
int main( )
{
ll n,x; cin>>n>>x;
ll a[n];
for( ll i=0; i<n; ++i )
{
cin>>a[i];
}
ll ans=max((ll)0,a[0]);
ll f[n],b[n], pre[n], suf[n], sum[n];
f[0]=a[0];
b[n-1]=a[n-1];
... | C++ | 92b6ab47c306a15631f045d624a1bf37 | a6ccf4465ddacc64fb24849e8a734037 | 1,900 | PASSED |
#include <bits/stdc++.h>
#define TVVTEYYZQB *
#define CWBFRFAXJQ +
#define KXYKRFQVXY ++){
#define QBPBHHSJRU -
#define ZJERMVFLZP 0){dp[i][j]
#define VVJMPJZJKY 0;
#define OCUDMUQZLC 0;j
#define TKNLLFXQBB 1){dp[i][j]
#define NXBTTXPNTD 1;i
#define ZQBDRAJWVB 1]
#define PUPUSJZGRX 1][j
#define RLDTJYNGJR 1][j]
#define... | C++ | 92b6ab47c306a15631f045d624a1bf37 | c6d636ae294aef161cb05e953173c5b7 | 1,900 | PASSED |
#include <bits/stdc++.h>
const int MAXN (1000005) ;
const int64_t INF = 0x3f3f3f3f3f3f3f3f3f ;
using namespace std ;
int64_t dp[MAXN][5] ;
// 0: 当前不乘k,前边也不乘k
// 1: 当前不乘k,前边乘k
// 2: 当前乘k
int64_t arr[MAXN] ;
int main()
{
int n,buff,k,t = 1 ;
ios::sync_with_stdio(false) ;
{
cin >> n >>k;
for(int i(1);i<=n;++i) {
... | C++ | 92b6ab47c306a15631f045d624a1bf37 | 6916ef24fea36ae7a9d80d92499ed0b2 | 1,900 | PASSED |
#include <iostream>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <queue>
#define LL long long
#define INF 1e9
#define eps 1e-9
#define PI acos(-1.0)
#define Exp 2.7182818284
using namespace std;
void init()
... | C++ | 92b6ab47c306a15631f045d624a1bf37 | 717b87ed9c895bbffeecf24cb5d5591b | 1,900 | PASSED |
#include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM(binsearch cmpNaive debug)
// --> binsearch cmpNaive f:<< debug
// ---- inserted library file binsearch.cc
template<typename T>
T binsearch(auto check, T yes, T no, T err = (T)1) {
while (abs(yes - no) > err) {
... | C++ | d2a612fb8415d1d6f518b5167f803298 | 55c863835ad6d465a90f06ae308eded3 | 2,400 | PASSED |
// Author: Sanskar Mani
// date: 2020-11-28 18:52:05
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#if DEBUG && !ONLINE_JUDGE
#include "... | C++ | d2a612fb8415d1d6f518b5167f803298 | 8a799d40a545bb8f9722950b75306dc4 | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,i,j;
cin>>n;
vector<int>a(n);
for(i=0;i<n;i++)cin>>a[i];
vector<int>I(n,-2),D(n,-2);
D[n-1]=-1;I[n-1]=INT_MAX;
for(i=n-2;i>=0;i--){
if(D[i+1]==-2 && I[i+1]==-2) break;
else if(D[i+1]==-2){
if(a[i]>a[i+1])
I[i]=I[i+... | C++ | d2a612fb8415d1d6f518b5167f803298 | c166b227085ffea92e711f216bf09761 | 2,400 | PASSED |
#include <bits/stdc++.h>
#define ll int
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
using namespace std;
const ll MAX_N=2e5,INF=1e8;
typedef pair<ll,ll> P;
ll n,a[MAX_N],ans[MAX_N],lis[MAX_N],bef[MAX_N],lisinx[MAX_N];
vector<P> lisary,dsary;
int main(){
scanf("%d",&n);
fill(lis,lis+n,INF);
... | C++ | d2a612fb8415d1d6f518b5167f803298 | b47641a0c71bdbccbe8340d9638a6216 | 2,400 | PASSED |
#include <bits/stdc++.h>
#include<cmath>
#define maxn 100005
#define maxa 1000005
#define MOD 998244353 //100000000 //1000000007 //
#define INF 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463
using namespace std;
#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#de... | C++ | d2a612fb8415d1d6f518b5167f803298 | aa89ad7a80363c4f13956280d57413ec | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10 ;
int arr[maxn] ;
int main(int argc, char const *argv[])
{
int n ;
scanf("%d",&n) ;
for(int i = 1 ; i <= n ; ++ i)
scanf("%d",&arr[i]) ;
arr[n+1] = maxn ;
int down = maxn , up = -1 ;
for(int i = 1 ; i <= n ; ++ i)
{
if(arr[i] < down && a... | C++ | d2a612fb8415d1d6f518b5167f803298 | a82d96d2095ee7ee1573a78c29e46c7d | 2,400 | PASSED |
#pragma GCC optimize("trapv")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include<bits/extc++.h>
using namespace __gnu_pbds;
//using namespace __gnu_cxx;
#define pb push_back
#define all(x) x.begin(), x.end()
using namespace std;
using l... | C++ | d2a612fb8415d1d6f518b5167f803298 | 2aea760cb3f3071a58eeab8b5063338c | 2,400 | PASSED |
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef double db;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
vector<int> ans(n, 0);
int inc = -1, dec = 1e9;
... | C++ | d2a612fb8415d1d6f518b5167f803298 | 0983856925b14239b3574594a92d7ac0 | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define MAXN (int)(2*1e5 + 10)
#define MAXL 20
#define F first
#define endl "\n"
#define S second
#define MOD (int)(1e9 + 7)
#define lli long long int
#define sz(a) int(a.size())
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int n;
int vec[MAXN];
int at[MAXN];
int... | C++ | d2a612fb8415d1d6f518b5167f803298 | 748fcd975716889aa7737bbb247944f2 | 2,400 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int, int> pi;
main() {
int n;
cin >> n;
int a[n];
pi dp[n][2];
for (int &i : a) cin >> i;
dp[0][0].first = 300000, dp[0][1].first = -1;
for (int i = 1; i < n; ++i) {
if (a[i] > a[i - 1] && a[i] > dp[i - 1][1].first) dp... | C++ | d2a612fb8415d1d6f518b5167f803298 | d48b6992f0586f023b54214163aa58d2 | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;cin>>t;
for(int i=0;i<t;++i){
int n;
cin>>n;
int ans=0;
while(n >= 10){
ans += (n / 10)*10;
n = n%10+n/10;
}
ans+=n;
cout<<ans<<'\n';
}return 0;
} | C++ | 0beecbd62aa072a2f3aab542eeb56373 | fc151972cca73e2fbf0b1194fd42f772 | 900 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/
#define pb push_back
#define ll long long
#define str string
#define fi first
#define se seco... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | 2b27263e6f81b8c28c3beaf2ed91848f | 900 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
///https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/
#define pb push_back
#define ll long long
#define str string
#define fi first
#define se s... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | 2e932ad449b2d923837df2fdb8243565 | 900 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll a,b,c;
int main()
{
cin>>a;
for(ll i=0;i<a;i++)
{
cin>>b;
while(b>=10)
{
c+=b/10*10;
b=b/10+b%10;
}
c+=b;
cout<<c<<endl;
c=0;
}
}
| C++ | 0beecbd62aa072a2f3aab542eeb56373 | b00f35ac6022b0866e5b229334a9065c | 900 | PASSED |
/**-------------------------
|--------From A.R.A--------|
-------------------------**/
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define FOR(i,n) for(ll i=0;i<n;i++)
#define input (a,i,n)for(ll i=0;i<n;i++){ cin>>a[i];}
#define output(a,i,n)for(ll i=0;i<n;i++){cout<<a[i]... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | 29ec7d4651f2e0ccdf7858f070f1edf5 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std ;
int solve ( int n ) {
vector < int > cashback ;
while ( 1 ) {
if ( n < 10 ) {
break ;
}
cashback . push_back ( n / 10 ) ;
n = n % 10 + n / 10 ;
}
int cur = 0 ;
for ( int i = 0 ; i < cashback . size ( ) ; ++ i ) {
cur += cashback [ i ] ;
}
return cur ;
}... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | ef79215da678a6632c12940085f2ecd6 | 900 | PASSED |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int t,n,carry;
ll ans ;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin>>t;
while (t--)
{
cin>>n;
ans=n;
while (n>=10)
{
carry=n%10;
n/=10;
ans+=n;
n=n+carry;
}
cout<<a... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | 3279fb27a4e43cf7ac461138e477ab43 | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f1(i,n) for(ll i=1;i<=n;i++)
#define f0(i,n) for(ll i=0;i<n;i++)
#define fr(i,n) for(ll i=n-1;i>0;i--)
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main()
{sync
ll t,i;cin>>t;
while(t--)
{cin>>i;cout<<i+((i-1)/9... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | dff1f91dad5a660bcbf7641510592c9c | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,s,m,k,p,l,i,j;
cin>>n;
while(n>0) {
cin>>k;
s=0;
l=k;
while(l>=10) {
p=l/10;
s+=p;
l=l%10;
l+=p;
}
cout<<k+s<<endl;
n--;
}
return 0;
} | C++ | 0beecbd62aa072a2f3aab542eeb56373 | b93fe7a9863346f9970bab71f25d430e | 900 | PASSED |
/*** بسم الله الرحمن الرحيم ***/
/*
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<forward_list>
#include<unordered_map>
#include<cctype>
#include<set>
#include<list>
#include<string>
#include<map>
#include<forward_list>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC o... | C++ | 0beecbd62aa072a2f3aab542eeb56373 | 21b3a4dd19c986397b9810b1be179e54 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
char a[105][105];
int main()
{
int n, m, i, j, d=0, xl=200, xh=-1, cnt=0, yl=200, yh=-1;
char ch;
scanf("%d %d\n", &n, &m);
for(i=0; i<n; i++)
{
gets(a[i]);
}
for(i=0; i<n; i++)
{
for(j=0; j<m; j++)
{
if(a... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | ecaafc880976468639ab7a657033a693 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,r1=101,r2=1,c1=101,c2=1,i,j,co=0,c,r;
char s[101][101];
cin>>n>>m;
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
cin>>s[i][j];
if(s[i][j]=='B' ){
r1=min(r1,i);
r2=max(r2,i);
... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | 7a03b08b69a3ad9fe34237ef7723184e | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,r1=101,r2=1,c1=101,c2=1,i,j,co=0,c,r;
char s[101][101];
cin>>n>>m;
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
cin>>s[i][j];
if(s[i][j]=='B' ){
r1=min(r1,i);
r2=max(r2,i);
... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | 124770b3d1965062888a57f47732c90e | 1,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = (int)1e9 + 7;
const int N = (int)1e7 + 7;
#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
char c[105][105];
int main () {
int n, m, x, y; scanf ("%d %d", &n, &m);
... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | 9402ac3b964de02400634e08c338322c | 1,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = (int)1e9 + 7;
const int N = (int)1e7 + 7;
#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
char c[105][105];
int main () {
int n, m, x, y; scanf ("%d %d", &n, &m);
... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | 4f08c4c078e4928fbd7a59a733535939 | 1,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = (int)1e9 + 7;
const int N = (int)1e7 + 7;
#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
char c[105][105];
int main () {
int n, m, x, y; scanf ("%d %d", &n, &m);
... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | e196175f6608834302befdb07341940a | 1,300 | PASSED |
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<string> arr(n);
for(int i=0;i<n;i++)
cin>>arr[i];
long left = m-1,right = 0,up = n-1,down = 0;
long blacks = 0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | 2b315fc35c80d36210f07661b9ec7f82 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll i,j,n,m,r=0,c=0,res=0,d=0,cl=0,col=0,total=0,mx=0,mn=1e15;
cin>>n>>m;
bool f=0,flag=0;
string s[n+1];
for(i=1; i<=n; i++)
cin>>s[i];
for(i=1; i<=n; i++)
{
f=c=d=0;
for(j=0; j<m; j++... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | d7107f6e27639482e659e029ab87e3b3 | 1,300 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
int n, m;
cin >> n >> m;
vector<vector<char> > a(n, vector<char>(m));
int kol = 0;
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
cin >> a[i][j];
kol += (a... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | 38c5473569206fa235b6f9499018c297 | 1,300 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
typedef long long LL;
//#pragma comment(linker, "/STACK:102400000,102400000")
const double PI = acos(-1.0);
const double eps = 1e... | C++ | cd6bc23ea61c43b38c537f9e04ad11a6 | b6460349502119f4dd1a2478281472bb | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N=2e3+5;
int n,m;
bool vis[N][N];
int dr[] = {0, 0, 1, -1};
int dc[] = {1, -1, 0, 0};
pair<int,int> ans;
bool valid(int r,int c){
return r>=0 && c>=0 && r<n && c<m;
}
queue<pair<int,int>>q;
void bfs(){
while(!q.empty()){
pair<int,int> u=q.front();... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 640c37052bb4275da674add8a8a546d2 | 1,500 | PASSED |
#include<cstdio>
#include<cstring>
#include<queue>
#include<math.h>
#include<iostream>
using namespace std;
typedef long long ll;
const int maxn=2010;
int vis[maxn][maxn];
struct node
{
int x,y;
node (int a,int b)
{
x=a,y=b;
}
};
int n,m;
int Max;
bool check(int x,int y);
void init(int nn,int mm... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 5f69b98bc99d969185ad4503078842dd | 1,500 | PASSED |
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
struct point
{
int x, y;
} pt[11];
const int maxn = 2500;
int mp[maxn][maxn];
int main()
{
freopen("input.txt","r",stdin);//这几句很神奇,不知道为什么加上这个就可以运行过去,不加就过不去
freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
i... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 84f143763a2aa535f69d9b3be714c4fd | 1,500 | PASSED |
#include<iostream>
#include<cmath>
#include<stdio.h>
#include <ctype.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<deque> //<< fixed << setprecision()
#include<queue> //priority_queue
#include<vector>
#include<ctime>
#include<time.h>
typedef long long l... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 34acaaf966ec68e1b632a0a896f8b868 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define fr(i,s,e) for(i=s;i<e;i++)
#define rf(i,s,e) for(i=s-1;i>=e;i--)
#define pb push_back
#define eb emblace_back
#def... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 08a1c3d0d13741bc159f1611b40ba255 | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define ma 1000006
bool visit[2010][2010]={};
int main() {
// your code goes here
/* fstream fre;
fre.open("input.txt",ios::in);
fstream fr;
fr.open("output.txt"... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 839cec4f17fed033fca714e7e1db5484 | 1,500 | PASSED |
/*
author Mahmoud Tarek
--------------------
keep it simple gcc just accept my solution :) it is flow less good bye ....
dear overflow don't be sad /// in case of any error we just still friend :)
... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 0d145dc8f456ba9f60ae20a993228bab | 1,500 | PASSED |
/*
author Mahmoud Tarek
--------------------
keep it simple gcc just accept my solution :) it is flow less good bye ....
dear overflow don't be sad /// in case of any error we just still friend :)
... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | e633a9765f2f1465dd472c41515c844d | 1,500 | PASSED |
/*
author Mahmoud Tarek
--------------------
keep it simple gcc just accept my solution :) it is flow less good bye ....
dear overflow don't be sad /// in case of any error we just still friend :)
... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | decc6b129c742665bdcd25dbf861dd10 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mk make_pair
#define ub upper_bound
#define lb lower_bound
#define ff first
#define ss second
#define inf 1000000009
#define mod 1000000007
#define vll vector<ll>
#define for0(i,n) for(ll i=0;i<n;i++)
#define all(c) c.be... | C++ | 1a740b0ad2ec3ed208f01fc7b64e00d4 | 88ca376c69e61d239c5a7f7c69c13ac9 | 1,500 | PASSED |
#include<cstdio>
#include<cctype>
#include<algorithm>
int n, z;
int a[200010];
bool charvis[128];
inline int fastRead() {
int X = 0,w = 0; char ch = getchar();
while(!charvis[ch]) {w |= ch == '-';ch = getchar();}
while(charvis[ch]) X = (X << 3) + (X << 1) + (ch ^ 48),ch=getchar();
return w ? -X : X;
}
i... | C++ | b063660572a78f25525656332a1782a8 | 8ce9083add9f981a5c2d822889c496e3 | 2,000 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<set>
#include<queue>
using namespace std;
#pragma GCC optimize(2)
int n, z;
int a[200010];
int main()
{
cin >> n >> z;
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
int ... | C++ | b063660572a78f25525656332a1782a8 | 70a895db228e39460db6d8e97f019d1f | 2,000 | PASSED |
#include<cstdio>
#include<algorithm>
int n, z;
int a[200010];
inline int fastRead()
{
int x = 0;
char ch = '-';
while(ch < '0' || ch > '9') ch = getchar();
while('0' <= ch && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
return x;
}
int main()
{
n = fastRead();
... | C++ | b063660572a78f25525656332a1782a8 | ed68a60e786d6cb9d50ecd7f24863512 | 2,000 | PASSED |
#include<cstdio>
#include<algorithm>
int n, z;
int a[200010];
void fastRead(int &x)
{
x = 0;
char ch = '-';
while(ch < '0' || ch > '9') ch = getchar();
while('0' <= ch && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
}
int main()
{
fastRead(n);
fastRead(z);
for (... | C++ | b063660572a78f25525656332a1782a8 | 92e3110dbaa6575ff82bdf549c744501 | 2,000 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<set>
#include<queue>
using namespace std;
#pragma GCC optimize(2)
int n, z;
int a[200010];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> z;
for (int i = 0; ... | C++ | b063660572a78f25525656332a1782a8 | f01ce5f2b957405b76d8321e62c6915e | 2,000 | PASSED |
#include<cstdio>
#include<algorithm>
int n, z;
int a[200010];
inline void fastRead(int &x)
{
x = 0;
char ch = '-';
while(ch < '0' || ch > '9') ch = getchar();
while('0' <= ch && ch <= '9')
{
x = x * 10 + ch - '0';
ch = getchar();
}
}
int main()
{
fastRead(n);
fastRead(z);... | C++ | b063660572a78f25525656332a1782a8 | 6c4586661897aa518a13237ec8f7ebf3 | 2,000 | PASSED |
#include<cstdio>
#include<cctype>
#include<algorithm>
int n, z;
int a[200010];
inline int fastRead() {
int X = 0,w = 0; char ch = getchar();
while(ch < '0' || ch > '9') {w |= ch == '-';ch = getchar();}
while('0' <= ch && ch <= '9') X = (X << 3) + (X << 1) + (ch ^ 48),ch=getchar();
return w ? -X : X;
}
i... | C++ | b063660572a78f25525656332a1782a8 | add7246c5173d26ed3600c838628a478 | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[maxn], vis[maxn];
int main()
{
int n, m;
scanf("%d%d",&n,&m);
for(int i = 1; i <= n; i++) scanf("%d",&a[i]);
sort(a+1,a+n+1);
int ans = 0;
for(int i = 1, j = n/2+1; i <= n/2+1; i++){
if(vis[i]) continue;
... | C++ | b063660572a78f25525656332a1782a8 | 1af633c69fdd328373718aba04877ba6 | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
/*
upsolving after understanding the editorial thoroughly!!
my thoughts / effort before reading editorial :
-> sorting is obvious as it gives
_________________________________
small values | big values
_____... | C++ | b063660572a78f25525656332a1782a8 | 93c7c34e71cd3758f9400cf8e6c6d2c8 | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 200043;
int n, z;
int a[N];
// editorial solution check
int main()
{
scanf("%d", &n);
scanf("%d", &z);
for(int i = 0; i < n; i++)
scanf("%d", &a[i]);
sort(a, a + n);
int l = 0;
int r = n / 2 + 1;
while(r - l > 1)
{
int m = (l + r) / 2;
bool goo... | C++ | b063660572a78f25525656332a1782a8 | 5fd28ae347b21d9f3d458371506fa815 | 2,000 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <math.h>
#include <stack>
#include <tuple>
#include <cstring>
#include <chrono>
#include <bitset>
#include <list>
#include <stdlib.h>
#in... | C++ | f94165f37e968442fa7f8be051018ad9 | f057ade52ab50247f041d77c0550df37 | 1,800 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <math.h>
#include <stack>
#include <tuple>
#include <cstring>
#include <chrono>
#include <bitset>
#include <list>
#include <stdlib.h>
#in... | C++ | f94165f37e968442fa7f8be051018ad9 | e372d34bd227a2f9a77899fd0fc430f7 | 1,800 | PASSED |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <math.h>
#include <stack>
#include <tuple>
#include <cstring>
#include <chrono>
#include <bitset>
#include <list>
#include <stdlib.h>
#in... | C++ | f94165f37e968442fa7f8be051018ad9 | 824a3cdcc921abcf02246e27914de579 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector < pair< ll , pair<ll,ll> > > edges;
pair<ll,ll> q[400005];
ll print [400005];
ll ans;
ll par [400005];
ll siz [400005];
ll prog [400005];
ll f(ll x){
while(x!=par[x])x=par[x];
return x;
}
void unite(ll x,ll y){
if(siz[x]<siz... | C++ | f94165f37e968442fa7f8be051018ad9 | 47306283e8edfcddc00f3e8e03e84532 | 1,800 | PASSED |
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
typedef long long int lli;
#define scanvector(a,n) vector<lli>a; for(lli i=0;i<n;i++) { lli x ; cin>>x; a.push_back(x);}
#define scanmatrix(a,n,m) vector<vector<lli> > a(n,vector<lli> (m,0));for (lli i=0;i<n;i++){for (int j=0;j<m;j++){lli temp;cin>>temp;a[i... | C++ | f94165f37e968442fa7f8be051018ad9 | 22c66b04e6c97b53c132b77c124fa187 | 1,800 | PASSED |
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
typedef long long int lli;
#define scanvector(a,n) vector<lli>a; for(lli i=0;i<n;i++) { lli x ; cin>>x; a.push_back(x);}
#define scanmatrix(a,n,m) vector<vector<lli> > a(n,vector<lli> (m,0));for (lli i=0;i<n;i++){for (int j=0;j<m;j++){lli temp;cin>>temp;a[i... | C++ | f94165f37e968442fa7f8be051018ad9 | f929978d799ea9925d56da92cf190c37 | 1,800 | PASSED |
/*
author: parv2809
*/
#include<bits/stdc++.h>
#define int long long int
#define mod 1000000007
#define inf 1e18
#define fo(i,y,n,inc) for(int i=y;i<n+y;i+=inc)
#define cin(t) int t;cin>>t
#define w(t) while(t--)
#define nl cout<<endl;
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ft(i) ... | C++ | f94165f37e968442fa7f8be051018ad9 | d12754e970f755f9be84f38232545826 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define LOCAL_PROJECTx
#ifndef LOCAL_PROJECT
#define debug(x)
#define debuga(a, n)
#define debug2(x, y)
#define debug3(x, y, z)
#define debug4(x, y, z, w)
#else
#define debug(x) {cerr <<#x<<" = " <<x<<"\n"; }
#define debuga(a, n) {cerr << #a << " = "; fo... | C++ | f94165f37e968442fa7f8be051018ad9 | 4664ecb450095d66d12238a809f8a18f | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define LOCAL_PROJECTx
#ifndef LOCAL_PROJECT
#define debug(x)
#define debuga(a, n)
#define debug2(x, y)
#define debug3(x, y, z)
#define debug4(x, y, z, w)
#else
#define debug(x) {cerr <<#x<<" = " <<x<<"\n"; }
#define debuga(a, n) {cerr << #a << " = "; fo... | C++ | f94165f37e968442fa7f8be051018ad9 | 1dd00fcd3c13e88d9547f7f0f13d9307 | 1,800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define ld long double
#define endl "\n"
#define ld long double
#define ff first
#define ss second
#define pi pair<int,int>
#define PI 3.141592653589793238462643383279502884L
#de... | C++ | f94165f37e968442fa7f8be051018ad9 | e035788bf15740a1c7ec68db12f6a77b | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int n, a, b, t;
char s[600000];
vector<ll> pre, suf;
bool f(int mid)
{
for (int i = 1; i < mid; ++i) {
ll all = pre[i] + 1LL*i*a + suf[mid-i];
if (all <= t){
return 1;
}
a... | C++ | e53eabd41647dc17bd8daf060d736c63 | ed0c4b8627316cb78532c16272a43698 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 500;
int n , a , b , T , st[maxn];
char str[maxn];
long long dpL[maxn] , dpR[maxn];
/*
w -> 0 , h -> 1;
初始时是 h -> 1
*/
inline void updata( long long & x , long long v) {
x = min( x , v );
}
void init(){
long long add = 0;
for(int i = 1 ; i <... | C++ | e53eabd41647dc17bd8daf060d736c63 | c7b8be642d5a3db7c5783848b8029302 | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int ary[550000],sum[550000];
main(){
int n,a,b,t,i;
scanf("%d%d%d%d",&n,&a,&b,&t);
for(i=0;i<n;i++){
char c;
scanf(" %c",&c);
if(c=='h')ary[i]=(i==0)?1:a+1;
else ary[i]=(i==0)?b+1:a+b+1;
}
sum[0]=0;
for(i=n-1;i>=0;i--)s... | C++ | e53eabd41647dc17bd8daf060d736c63 | eca5f60fcf25c0602954057d8b75c0a1 | 1,900 | PASSED |
#include<iostream>
#include<cstring>
#include<cassert>
using namespace std;
typedef long long ll;
const int MAXN = 1e6;
const int MAXT = 2e9;
const int MAXA = 2e3;
int N;
ll A, B, T;
char s[MAXN];
int sum[MAXN];
// can we see v photos
bool is_good(int v) {
for(int l = 0; l < v; l++) {
int r = v - l;
ass... | C++ | e53eabd41647dc17bd8daf060d736c63 | 623104127775180e2976eb571d8fa09d | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,t,z;
int n;
cin>>n>>a>>b>>t;
string c;
vector<long long> sum;
sum.push_back(0);
cin>>c;
for(int i=0;i<n;i++){
z=0;
if(c[i]=='w') z++;
sum.push_back(sum[sum.size()-1]+z);
}
for(int i=0;i<n;i++){
z=0;
if(c[i]=='w') z++;
sum.... | C++ | e53eabd41647dc17bd8daf060d736c63 | becb47fb5aed4ffec8196b256ccba290 | 1,900 | PASSED |
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define FILE ""
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = numeric_limits<int>::max();
const ll LLINF = numeric_limits<ll>::max();
const ull ULLINF = numeric_limit... | C++ | e53eabd41647dc17bd8daf060d736c63 | d1208fd37b793919c9f0f023f4273b2c | 1,900 | PASSED |
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <algorithm>
#include <ctype.h>
#include <bitset>
#include <iostream>
using namespace std;
#define MAXN 500010
#define INF 0x3f3f3f3f
#define PI acos(-1.0)
#define mo 1000000007
typedef long long LL;
int n,a,b,T,ans;
char s[MAXN];
LL f[2][... | C++ | e53eabd41647dc17bd8daf060d736c63 | 03f72c2476d0d4db9e3bfde8c88db053 | 1,900 | PASSED |
// :)
// All hail Leonardo Watch!
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define F first
#define S second
const int MAX = 5e5+9;
const int MOD = 1e9+7;
int p1[MAX], p2[MAX];
int main () {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n, a, b... | C++ | e53eabd41647dc17bd8daf060d736c63 | 464cfc6797b3f79a40f8e1b5d4889f81 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N=500010;
char ss[N];
int n,a,b,T;
int t1[N],t2[N],ans;
int main()
{
scanf("%d%d%d%d",&n,&a,&b,&T);
scanf("%s",ss);
t1[0]=1+(ss[0]=='w'?b:0);
if(t1[0]<=T) ans=1;
for(int i=1;i<n;i++)
{
t1[i]=t1[i-1]+a+1;
if(ss[i]=='w')
... | C++ | e53eabd41647dc17bd8daf060d736c63 | 5296bb9a867c89c82975a6d4c2f66e6f | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a,b,T,i,j,temp,le,ri,mid,ma=0;
cin>>n>>a>>b>>T;
char str[n];
cin>>str;
int r[n],l[n];
if(str[0]=='h')
r[0]=1;
else
r[0]=b+1;
for(i=1;i<n;i++){
if(str[i]=='h')
r[i]=r[i-1]+a+1;
... | C++ | e53eabd41647dc17bd8daf060d736c63 | c75f766edd0df859f06b7a0d0692946c | 1,900 | PASSED |
#include <iostream>
#include <cmath>
int t,d,n;
using namespace std;
int main() {
cin >> t;
while(t--)
{
cin >> n >> d;
for(int i=0; i<=n-1; i++)
{
if((i + ceil((double)d/(i+1)))<=n)
{
cout << "YES" << endl;
break;
}
else if(i==n-1)
{
cout << "... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | d37e548298239a051d2492c041277e89 | 1,100 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t,i,cnt=0,tmp=1;
scanf("%d",&t);
vector<int>vc;
map<int,int>mp;
for(int i=0;i<t;i++){
int n,d;
cnt=0;
scanf("%d %d",&n,&d);
if(d<=n){
printf("YES\n");
continue;
}
in... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | 502cf25f7106f0f61dc1375931869055 | 1,100 | PASSED |
#include<bits/stdc++.h>
#define int long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(a) a.begin(),a.end()
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define pii pair<int,int>
using namespace std;
signed main()
{
fast;
int t;
... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | 9d01bac21b5ebfccb69daa1e80ecc3b7 | 1,100 | PASSED |
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);
int t;
cin>>t;
while(t--)
{
double a,b;
cin>>a>>b;
int k=0;
for(int i=0;i<=a;i++)
{
if((i+ceil(b/(i+1)))<=a)
{
k=1;break;
}
}
if(k)cout<<"YES"<<'\n';
else cout<<"NO"<<'\n'... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | d93a068c61cb5a97b8141b4c856bb36a | 1,100 | PASSED |
//By :Prajwal Sonawane
//Email :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using na... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | 39c1e5a021d4ccb490c710448bd18461 | 1,100 | PASSED |
# include <bits/stdc++.h>
using namespace std ;
int alisher, n, d, x1, x2, ok;
int main () {
cin >> alisher ;
while( alisher -- ) {
cin >> n >> d ;
int kj = 11212 ;
if( kj == 1 ) cout << 12 << endl;
if( n == 1 ) {
if( n == d ) cout <<... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | 23cad9e192b2e8c9bf5ec5f2a286b47b | 1,100 | PASSED |
# include <bits/stdc++.h>
using namespace std ;
int alisher, n, d, x1, x2, ok;
int main () {
cin >> alisher ;
while( alisher -- ) {
cin >> n >> d ;
int kj = 11212 ;
if( kj == 1 ) cout << "jdshfkjs" << endl;
if( n == 1 ) {
if( n == d )... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | bb895d8436c9dbc77cfb7b50ecbde764 | 1,100 | PASSED |
# include <bits/stdc++.h>
using namespace std ;
int alisher, n, d, x1, x2, ok;
int main () {
cin >> alisher ;
while( alisher -- ) {
cin >> n >> d ;
if( n == 1 ) {
if( n == d ) cout << "YES" << endl;
else cout << "NO" << endl;
continue ;
... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | fc148e87077606fd1fba221da38f035f | 1,100 | PASSED |
# include <bits/stdc++.h>
using namespace std ;
int alisher, n, d, x1, x2, ok;
int main () {
cin >> alisher ;
while( alisher -- ) {
cin >> n >> d ;
if( n == 1 ) {
if( n == d ) cout << "YES" << endl;
else cout << "NO" << endl;
continue ;
... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | b2dc000f4943f05b640573d707804514 | 1,100 | PASSED |
# include <bits/stdc++.h>
using namespace std ;
int alisher, n, d, x1, x2, ok;
int main () {
cin >> alisher ;
while( alisher -- ) {
cin >> n >> d ;
if( n == 1 ) {
if( n == d ) cout << "YES" << endl;
else cout << "NO" << endl;
continue... | C++ | e65b2a81689bb13b90a02a9ccf1d4125 | d829a2b930b76c399348b7a6cb79a8b0 | 1,100 | PASSED |
#include <iostream>
using namespace std;
int main() {
int q; cin >> q;
long long n;
while (q--)
{
cin >> n;
if (n==2)cout<<n<<'\n';
else if (n%2==0)cout<<0<<'\n';
else cout <<1<<'\n';
}
return 0;
}
| C++ | 178876bfe161ba9ccfd80c9310f75cbc | ec53a2804fbff9d62e2f76ff8149eb53 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
int n,k;
cin >> t;
while(t--)
{
cin >> n;
if(n == 1)
{
cout << 3 << endl;
continue;
}
if(n == 2)
{
... | C++ | 178876bfe161ba9ccfd80c9310f75cbc | 0b0557206374ffd444b5d6582d218ac2 | 800 | PASSED |
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define F first
#define S second
#define sqr(x) ((x) * (x... | C++ | 178876bfe161ba9ccfd80c9310f75cbc | adca9d70f572c94dca6a5d043d89710e | 800 | PASSED |
#include <iostream>
using namespace std;
int main(){
int q;
cin>>q;
while(q--){
int n;
cin>>n;
if(n==2){
cout<<2<<endl;
continue;
}
if(n%2==0){
cout<<0<<endl;
continue;
}
cout<<1<<endl;
}
return 0;
}
| C++ | 178876bfe161ba9ccfd80c9310f75cbc | c217d08e880c9f778b5978036cdb646a | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin>>t;
while (t--) {
int x; cin>>x;
if (x<4) cout<<4-x;
else cout<<x%2;
cout<<"\n";
}
return 0;
} | C++ | 178876bfe161ba9ccfd80c9310f75cbc | c7025542dfb31f9d8358db57b1ce1953 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define endl "\n"
#define vci vector<int>
#define vcl vector<long long>
#define mpi map<int,int>
#define mpl map<long long,long long>
#define vecp vector<pair<<int,int> >
int main()
{
ll n... | C++ | 178876bfe161ba9ccfd80c9310f75cbc | 293a1982f951cbfbacbb450a1efd3573 | 800 | PASSED |
#include <bits/stdc++.h>
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define debug(a) cerr<<#a<<" -- "<<a<<endl;
using namespace std;
#define ll long long int
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll n,t,a,b,x;
cin>>t;
while(t--){
cin>>n... | C++ | 178876bfe161ba9ccfd80c9310f75cbc | 29a2320cfa742e34e95f46b0854cb2e8 | 800 | PASSED |
#include <bits/stdc++.h>
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define debug(a) cerr<<#a<<" -- "<<a<<endl;
using namespace std;
#define ll long long int
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll n,t;
cin>>t;
while(t--){
cin>>n;
... | C++ | 178876bfe161ba9ccfd80c9310f75cbc | 414b63a3e7a78e3ff1772d946539a429 | 800 | PASSED |
//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
int main(){
int q, n[1000];
cin >> q;
for(int i = 0; i < q; i++){
cin >> n[i];
}
for(int i = 0; i < q; i++){
if(n[i] == 2)
cout << 2 << endl;
else
cout << n[i] % 2 << endl;
}
return 0;
}
| C++ | 178876bfe161ba9ccfd80c9310f75cbc | 18ba215aff753e9b9f379f7073fa4983 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
if(n==1)
cout<<3<<endl;
else... | C++ | 178876bfe161ba9ccfd80c9310f75cbc | 6ea7d6472e8851c1fc521d79cc594a6a | 800 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.