Submission #967970

#TimeUsernameProblemLanguageResultExecution timeMemory
967970Darren0724Line Town (CCO23_day1problem3)C++17
0 / 25
1 ms352 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(),x.end() #define ll long long #define LCBorz ios_base::sync_with_stdio(false);cin.tie(0); const int N=1000005; const int mod=1e6+3; int32_t main(){ LCBorz; int n;cin>>n; vector<int> v(n+1); for(int i=1;i<=n;i++){ cin>>v[i]; } int ans=0; int lz=0; for(int i=n;i>=1;i--){ if((v[i]<0)^lz){ if(i%2==0){ cout<<0<<endl; return 0; } lz^=1; ans+=(i-1); } } cout<<ans<<endl; return 0; }
#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...