Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
codechef - COVID Pandemic and Long Queue
jakaria_hossain
Apr 9th, 2020
59
Never
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
C++
0.92 KB
raw
download
clone
embed
print
report
RAW Paste Data
#include<bits/stdc++.h> using namespace std; #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL)); #define ll long long int main() { fastread(); ll t; cin>>t; while(t--) { ll n; cin>>n; ll ara[n+1],i; for(i=0; i<n; i++) cin>>ara[i]; ll x; bool f=false,f1=true;; for(i=0; i<n; i++) { if(ara[i]==1) { if(f) { if(i-x>=6) x=i; else { printf("NO\n"); f1=false; break; } } else { x=i; f=true; } } } if(f1)printf("YES\n"); } }
Public Pastes
OWEO PLS
Java | 3 min ago
triangles
JavaScript | 36 min ago
Roof+
Lua | 38 min ago
Untitled
PHP | 1 hour ago
Untitled
Java | 1 hour ago
Untitled
Java | 1 hour ago
celery
Python | 1 hour ago
Arr
C# | 2 hours ago
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!