Submission #5904147
Source Code Expand
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) int main(){ int n;cin>>n; vector<int>a(n); for(auto&& u:a)cin>>u; for(int i=3;i<n;i+=2){ int j=i-1; while(j>=0&&a[j]!=a[i])j--; if(j<i-1){ for(int k=j+1;k<i;k++)a[k]=a[i]; } } int ret=0; for(auto&& u:a)if(u==0)ret++; cout<<ret<<endl; }
Submission Info
Submission Time | |
---|---|
Task | D - Snuke Numbers |
User | mnrutd |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 357 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample.txt |
All | sample.txt, 1.txt, sample.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
1.txt | WA | 1 ms | 256 KB |
sample.txt | WA | 1 ms | 256 KB |