Submission #69543162
Source Code Expand
#include <stdio.h>
int main(void) {
int N, i;
int first = -1, last = -1;
if (scanf("%d", &N) != 1) return 1;
for (i = 0; i < N; i++) {
int L;
if (scanf("%d", &L) != 1) return 1;
if (L) {
if (first < 0) first = i;
last = i;
}
}
printf("%d\n", last - first);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Locked Rooms |
| User | mikecat |
| Language | C (gcc 12.2.0) |
| Score | 200 |
| Code Size | 308 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 1740 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample00.txt, sample01.txt, sample02.txt |
| All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt, testcase22.txt, testcase23.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample00.txt | AC | 0 ms | 1636 KiB |
| sample01.txt | AC | 0 ms | 1728 KiB |
| sample02.txt | AC | 0 ms | 1740 KiB |
| testcase00.txt | AC | 0 ms | 1712 KiB |
| testcase01.txt | AC | 0 ms | 1720 KiB |
| testcase02.txt | AC | 0 ms | 1580 KiB |
| testcase03.txt | AC | 0 ms | 1624 KiB |
| testcase04.txt | AC | 0 ms | 1624 KiB |
| testcase05.txt | AC | 0 ms | 1640 KiB |
| testcase06.txt | AC | 0 ms | 1704 KiB |
| testcase07.txt | AC | 0 ms | 1624 KiB |
| testcase08.txt | AC | 0 ms | 1724 KiB |
| testcase09.txt | AC | 0 ms | 1648 KiB |
| testcase10.txt | AC | 0 ms | 1628 KiB |
| testcase11.txt | AC | 0 ms | 1628 KiB |
| testcase12.txt | AC | 0 ms | 1728 KiB |
| testcase13.txt | AC | 0 ms | 1628 KiB |
| testcase14.txt | AC | 0 ms | 1596 KiB |
| testcase15.txt | AC | 1 ms | 1700 KiB |
| testcase16.txt | AC | 0 ms | 1600 KiB |
| testcase17.txt | AC | 0 ms | 1640 KiB |
| testcase18.txt | AC | 0 ms | 1644 KiB |
| testcase19.txt | AC | 0 ms | 1740 KiB |
| testcase20.txt | AC | 0 ms | 1648 KiB |
| testcase21.txt | AC | 0 ms | 1620 KiB |
| testcase22.txt | AC | 0 ms | 1716 KiB |
| testcase23.txt | AC | 0 ms | 1716 KiB |