Submission #47493114
Source Code Expand
#include<stdio.h>
int main() {
int i, N, X, S, count = 0, total = 0;
scanf("%d %d", &N, &X);
for(i = 1; i <= N; i++) {
scanf("%d", &S);
if(S <= X) {
total = S + count;
count = total;
}
}
printf("%d\n", total);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Not Too Hard |
| User | InFi4D_0 |
| Language | C (gcc 12.2.0) |
| Score | 100 |
| Code Size | 312 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 1736 KiB |
Compile Error
Main.c: In function ‘main’:
Main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d %d", &N, &X);
| ^~~~~~~~~~~~~~~~~~~~~~
Main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d", &S);
| ^~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, example0.txt, example1.txt, example2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 0 ms | 1636 KiB |
| 001.txt | AC | 0 ms | 1720 KiB |
| 002.txt | AC | 0 ms | 1624 KiB |
| 003.txt | AC | 0 ms | 1636 KiB |
| 004.txt | AC | 0 ms | 1720 KiB |
| 005.txt | AC | 0 ms | 1624 KiB |
| 006.txt | AC | 0 ms | 1592 KiB |
| 007.txt | AC | 0 ms | 1644 KiB |
| 008.txt | AC | 1 ms | 1736 KiB |
| 009.txt | AC | 0 ms | 1644 KiB |
| example0.txt | AC | 0 ms | 1736 KiB |
| example1.txt | AC | 0 ms | 1620 KiB |
| example2.txt | AC | 0 ms | 1608 KiB |