Submission #69045084
Source Code Expand
Copy
#include <stdio.h>#include <inttypes.h>uint64_t f(uint64_t x) {char s[32];uint64_t res = 0;int i;snprintf(s, sizeof(s), "%" PRIu64, x);for (i = 0; s[i] != '\0'; i++);for (i--; i >= 0; i--) res = res * 10 + s[i] - '0';return res;}int main(void) {uint64_t X, Y;uint64_t a[12];int i;if (scanf("%" SCNu64 "%" SCNu64, &X, &Y) != 2) return 1;a[1] = X;a[2] = Y;for (i = 3; i <= 10; i++) {
#include <stdio.h>
#include <inttypes.h>
uint64_t f(uint64_t x) {
char s[32];
uint64_t res = 0;
int i;
snprintf(s, sizeof(s), "%" PRIu64, x);
for (i = 0; s[i] != '\0'; i++);
for (i--; i >= 0; i--) res = res * 10 + s[i] - '0';
return res;
}
int main(void) {
uint64_t X, Y;
uint64_t a[12];
int i;
if (scanf("%" SCNu64 "%" SCNu64, &X, &Y) != 2) return 1;
a[1] = X;
a[2] = Y;
for (i = 3; i <= 10; i++) {
a[i] = f(a[i - 1] + a[i - 2]);
}
printf("%" PRIu64 "\n", a[10]);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Fibonacci Reversed |
| User | mikecat |
| Language | C (gcc 12.2.0) |
| Score | 200 |
| Code Size | 524 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 1704 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 1620 KiB |
| 00_sample_01.txt | AC | 1 ms | 1692 KiB |
| 00_sample_02.txt | AC | 1 ms | 1704 KiB |
| 01_random_00.txt | AC | 1 ms | 1696 KiB |
| 01_random_01.txt | AC | 1 ms | 1664 KiB |
| 01_random_02.txt | AC | 1 ms | 1704 KiB |
| 01_random_03.txt | AC | 1 ms | 1676 KiB |
| 01_random_04.txt | AC | 1 ms | 1620 KiB |
| 01_random_05.txt | AC | 1 ms | 1564 KiB |
| 01_random_06.txt | AC | 1 ms | 1692 KiB |
| 01_random_07.txt | AC | 1 ms | 1568 KiB |
| 02_handmade_00.txt | AC | 1 ms | 1628 KiB |
| 02_handmade_01.txt | AC | 1 ms | 1696 KiB |
| 02_handmade_02.txt | AC | 1 ms | 1704 KiB |
| 02_handmade_03.txt | AC | 1 ms | 1544 KiB |
| 02_handmade_04.txt | AC | 1 ms | 1704 KiB |