Submission #23291739
Source Code Expand
#include <stdio.h>
typedef long long ll;
int main(void) {
ll i, n, ans = 0, a;
scanf("%lld", &n);
for(i = 0; i < n; ++i) scanf("%lld", &a), ans += a > 10 ? a - 10 : 0;
printf("%lld", ans);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Nuts |
| User | masa002 |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 220 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 1728 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);
| ~~~~~^~~~~~~~~~~~
./Main.cpp:7:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
7 | for(i = 0; i < n; ++i) scanf("%lld", &a), ans += a > 10 ? a - 10 : 0;
| ~~~~~^~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 6 ms | 1728 KiB |
| random_02.txt | AC | 1 ms | 1648 KiB |
| random_03.txt | AC | 2 ms | 1656 KiB |
| random_04.txt | AC | 1 ms | 1652 KiB |
| random_05.txt | AC | 1 ms | 1680 KiB |
| random_06.txt | AC | 2 ms | 1712 KiB |
| random_07.txt | AC | 1 ms | 1652 KiB |
| random_08.txt | AC | 1 ms | 1676 KiB |
| sample_01.txt | AC | 1 ms | 1640 KiB |
| sample_02.txt | AC | 1 ms | 1728 KiB |