Please sign in first.
Submission #20957311
Source Code Expand
#include <stdio.h>
typedef long long ll;
int main(void) {
ll i, n, ans = 0;
scanf("%lld", &n);
for(i = 1000; i <= n; i *= 1000) ans += n - i + 1;
printf("%lld", ans);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Comma |
| User | masa002 |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 198 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 1712 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:6:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
6 | scanf("%lld", &n);
| ~~~~~^~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | AC | 6 ms | 1620 KiB |
| hand_02.txt | AC | 1 ms | 1688 KiB |
| hand_03.txt | AC | 2 ms | 1668 KiB |
| random_01.txt | AC | 2 ms | 1624 KiB |
| random_02.txt | AC | 1 ms | 1684 KiB |
| random_03.txt | AC | 2 ms | 1624 KiB |
| random_04.txt | AC | 1 ms | 1668 KiB |
| random_05.txt | AC | 1 ms | 1620 KiB |
| random_06.txt | AC | 2 ms | 1628 KiB |
| random_07.txt | AC | 1 ms | 1632 KiB |
| random_08.txt | AC | 1 ms | 1712 KiB |
| random_09.txt | AC | 1 ms | 1624 KiB |
| random_10.txt | AC | 1 ms | 1660 KiB |
| random_11.txt | AC | 1 ms | 1632 KiB |
| random_12.txt | AC | 1 ms | 1704 KiB |
| random_13.txt | AC | 1 ms | 1708 KiB |
| random_14.txt | AC | 1 ms | 1676 KiB |
| random_15.txt | AC | 1 ms | 1640 KiB |
| sample_01.txt | AC | 1 ms | 1636 KiB |
| sample_02.txt | AC | 1 ms | 1620 KiB |