Submission #3230309
Source Code Expand
/* 对于一个来说最多只能去掉一种颜色 所以每个a之间差不能超过1 */ #include<map> #include<vector> #include<cstdio> #include<cstring> #include<algorithm> #define gc getchar() #define pc putchar #define LL long long inline int read() { int x = 0,f = 1; char c = gc; while(c < '0' || c > '9')c = gc; while(c <= '9' && c >= '0') x = x * 10 + c - '0',c = gc; return x * f; } void print(int x) { if(x < 0) { pc('-'); x = -x; } if(x >= 10) print(x / 10); pc(x % 10 + '0'); } int main() { int n = read(); int mn = n + 1,mx = -1; for(int a,i = 1;i <= n;++ i) a = read(), mn = std::min(mn,a),mx = std::max(mx,a); if(mx - mn <= 1) { puts("Yes"); } else puts("No"); }
Submission Info
Submission Time | |
---|---|
Task | B - Colorful Hats |
User | socialzzx |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 766 Byte |
Status | WA |
Exec Time | 5 ms |
Memory | 128 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 0_05.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 0_05.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 0 ms | 128 KB |
0_01.txt | WA | 0 ms | 128 KB |
0_02.txt | WA | 0 ms | 128 KB |
0_03.txt | AC | 1 ms | 128 KB |
0_04.txt | AC | 0 ms | 128 KB |
0_05.txt | WA | 0 ms | 128 KB |
1_00.txt | AC | 0 ms | 128 KB |
1_01.txt | AC | 0 ms | 128 KB |
1_02.txt | AC | 2 ms | 128 KB |
1_03.txt | WA | 5 ms | 128 KB |
1_04.txt | AC | 5 ms | 128 KB |
1_05.txt | WA | 5 ms | 128 KB |
1_06.txt | AC | 5 ms | 128 KB |
1_07.txt | WA | 5 ms | 128 KB |
1_08.txt | WA | 2 ms | 128 KB |
1_09.txt | WA | 5 ms | 128 KB |
1_10.txt | WA | 2 ms | 128 KB |
1_11.txt | AC | 5 ms | 128 KB |
1_12.txt | WA | 5 ms | 128 KB |
1_13.txt | AC | 5 ms | 128 KB |
1_14.txt | WA | 5 ms | 128 KB |
1_15.txt | AC | 1 ms | 128 KB |
1_16.txt | AC | 1 ms | 128 KB |
1_17.txt | AC | 5 ms | 128 KB |