Submission #64232412
Source Code Expand
Copy
#include <stdio.h>int main(void) {int N, i;int combo = 0, maxcombo = 0, prev = -1;if (scanf("%d", &N) != 1) return 1;for (i = 0; i < N; i++) {int A;if (scanf("%d", &A) != 1) return 1;if (A == prev) {combo++;} else {combo = 1;prev = A;}if (combo > maxcombo) maxcombo = combo;}puts(maxcombo >= 3 ? "Yes" : "No");return 0;}
#include <stdio.h>
int main(void) {
int N, i;
int combo = 0, maxcombo = 0, prev = -1;
if (scanf("%d", &N) != 1) return 1;
for (i = 0; i < N; i++) {
int A;
if (scanf("%d", &A) != 1) return 1;
if (A == prev) {
combo++;
} else {
combo = 1;
prev = A;
}
if (combo > maxcombo) maxcombo = combo;
}
puts(maxcombo >= 3 ? "Yes" : "No");
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Triple Four |
| User | mikecat |
| Language | C (gcc 12.2.0) |
| Score | 100 |
| Code Size | 388 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 1644 KB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 1544 KB |
| 00_sample_01.txt | AC | 0 ms | 1560 KB |
| 00_sample_02.txt | AC | 0 ms | 1612 KB |
| 00_sample_03.txt | AC | 0 ms | 1628 KB |
| 00_sample_04.txt | AC | 0 ms | 1640 KB |
| 01_handmade_00.txt | AC | 0 ms | 1616 KB |
| 01_handmade_01.txt | AC | 1 ms | 1604 KB |
| 01_handmade_02.txt | AC | 0 ms | 1616 KB |
| 01_handmade_03.txt | AC | 0 ms | 1628 KB |
| 01_handmade_04.txt | AC | 0 ms | 1568 KB |
| 02_random_00.txt | AC | 1 ms | 1576 KB |
| 02_random_01.txt | AC | 0 ms | 1512 KB |
| 02_random_02.txt | AC | 0 ms | 1644 KB |
| 02_random_03.txt | AC | 0 ms | 1608 KB |
| 02_random_04.txt | AC | 0 ms | 1640 KB |
| 02_random_05.txt | AC | 0 ms | 1584 KB |
| 02_random_06.txt | AC | 1 ms | 1504 KB |
| 02_random_07.txt | AC | 1 ms | 1560 KB |
| 02_random_08.txt | AC | 0 ms | 1536 KB |
| 02_random_09.txt | AC | 1 ms | 1508 KB |