Submission #2867983
Source Code Expand
#include<iostream> using namespace std; int a[100005],n,x,s=0; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>x; if(a[x]==1)a[x]=0; else a[x]=1; } for(int i=1;i<=100005;i++)if(a[i]==1)s++; cout<<s<<endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Write and Erase |
User | wubaiting2020 |
Language | C++ (GCC 5.4.1) |
Score | 0 |
Code Size | 234 Byte |
Status | RE |
Exec Time | 98 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:13:34: warning: iteration 100004u invokes undefined behavior [-Waggressive-loop-optimizations] for(int i=1;i<=100005;i++)if(a[i]==1)s++; ^ ./Main.cpp:13:15: note: containing loop for(int i=1;i<=100005;i++)if(a[i]==1)s++; ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | RE | 96 ms | 256 KB |
02.txt | RE | 96 ms | 256 KB |
03.txt | RE | 96 ms | 256 KB |
04.txt | RE | 96 ms | 256 KB |
05.txt | RE | 96 ms | 256 KB |
06.txt | RE | 97 ms | 256 KB |
07.txt | AC | 26 ms | 256 KB |
08.txt | RE | 98 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |