Submission #94134

#TimeUsernameProblemLanguageResultExecution timeMemory
94134farukkastamonudaNizin (COCI16_nizin)C++14
100 / 100
89 ms6264 KiB
#include <bits/stdc++.h> #define md 1000000007 #define fi first #define se second #define mp make_pair #define inf 1000000000 #define li 1000005 #define lo long long #define pb push_back #define mid (start+end)/2 using namespace std; int n,A[li],cev; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&A[i]); int bas=1,son=n; while(bas<son){ if(A[bas]==A[son]){ bas++; son--; continue; } if(A[bas]<A[son]){ bas++; A[bas]+=A[bas-1]; cev++; continue; } if(A[bas]>A[son]){ son--; A[son]+=A[son+1]; cev++; continue; } } printf("%d\n",cev); return 0; }

Compilation message (stderr)

nizin.cpp: In function 'int main()':
nizin.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
nizin.cpp:15:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1;i<=n;i++) scanf("%d",&A[i]);
                        ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...