Submission #72304000
Source Code Expand
Copy
#include <stdio.h>#include <inttypes.h>int64_t ans[32][32];int main(void) {int a, b;int n;int i, j;if (scanf("%d%d", &a, &b) != 2) return 1;if (scanf("%d", &n) != 1) return 1;for (i = 0; i < n; i++) {int x, y;if (scanf("%d%d", &x, &y) != 2) return 1;ans[y][x] = -1;}ans[0][1] = 1;for (i = 1; i <= b; i++) {for (j = 1; j <= a; j++) {if (ans[i][j] < 0) {ans[i][j] = 0;
#include <stdio.h>
#include <inttypes.h>
int64_t ans[32][32];
int main(void) {
int a, b;
int n;
int i, j;
if (scanf("%d%d", &a, &b) != 2) return 1;
if (scanf("%d", &n) != 1) return 1;
for (i = 0; i < n; i++) {
int x, y;
if (scanf("%d%d", &x, &y) != 2) return 1;
ans[y][x] = -1;
}
ans[0][1] = 1;
for (i = 1; i <= b; i++) {
for (j = 1; j <= a; j++) {
if (ans[i][j] < 0) {
ans[i][j] = 0;
} else {
ans[i][j] = ans[i - 1][j] + ans[i][j - 1];
}
}
}
printf("%" PRId64 "\n", ans[b][a]);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | F - 通学経路 |
| User | mikecat |
| Language | C23 (GCC 14.2.0) |
| Score | 100 |
| Code Size | 561 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 1712 KiB |
Judge Result
| Set Name | set01 | set02 | set03 | set04 | set05 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 20 / 20 | 20 / 20 | 20 / 20 | 20 / 20 | 20 / 20 | ||||||||||
| Status |
|
|
|
|
|
| Set Name | Test Cases |
|---|---|
| set01 | data1 |
| set02 | data2 |
| set03 | data3 |
| set04 | data4 |
| set05 | data5 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| data1 | AC | 1 ms | 1656 KiB |
| data2 | AC | 0 ms | 1712 KiB |
| data3 | AC | 1 ms | 1656 KiB |
| data4 | AC | 0 ms | 1636 KiB |
| data5 | AC | 0 ms | 1656 KiB |