diff --git a/fashionableecodeforces.cpp b/fashionableecodeforces.cpp new file mode 100644 index 0000000..86706b2 --- /dev/null +++ b/fashionableecodeforces.cpp @@ -0,0 +1,18 @@ +#include +using namespace std; + +int main() +{ + int t,i,n; + cin>>t; + for(i=0;i>n; + if(n%4==0){ + cout<<"YES\n"; + } + else{ + cout<<"NO\n"; + } + } + return 0; +} \ No newline at end of file diff --git a/flippinggamecodeforces.cpp b/flippinggamecodeforces.cpp new file mode 100644 index 0000000..19ab2c1 --- /dev/null +++ b/flippinggamecodeforces.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; + +int main(){ + int n,a,c=0,x=0,m=0,r=-1; + cin>>n; + while(n--) + { + cin>>a; + c+=a; + x+=1-a*2; + r=max(r,x-m); + m=min(x,m); + } + cout< +using namespace std; + +int main(){ + int n,c=1,i=1,l; + cin>>n; + while(n>=c) + { + i++; + l=(i*(i+1))/2; + c+=l; + } + cout<