Submission #2211911
Source Code Expand
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FOR(i, a, b) for(i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define comp(a, b) int comp(const void *a, const void *b)
#define MOD 1000000007
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ull;
void TF_print(char boolean, char T[], char F[]){
if(boolean){
printf("%s\n", T);
}else{
printf("%s\n", F);
}
}
comp(a, b){
return *(uint*)a -*(uint*)b;
}
int main(){
uint N;
scanf("%u", &N);
uint S[N], i, full = 0;
REP(i, N){
scanf("%u", &S[i]);
full += S[i];
}
qsort(S, N, sizeof(uint), comp);
if(full % 10 == 0){
REP(i, N){
if(S[i] % 10 != 0){
full -= S[i];
break;
}
}
}
if(full % 10 == 0){
printf("0\n");
}else{
printf("%u\n", full);
}
return 0;
}
Submission Info
Submission Time
2018-03-16 18:18:54+0900
Task
C - Bugged
User
kumachan_atcoder
Language
C (GCC 5.4.1)
Score
300
Code Size
991 Byte
Status
AC
Exec Time
1 ms
Memory
128 KB
Compile Error
./Main.c: In function ‘main’:
./Main.c:28:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%u", &N);
^
./Main.c:31:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%u", &S[i]);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
300 / 300
Status
Set Name
Test Cases
Sample
a01, a02, a03
All
a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12
Case Name
Status
Exec Time
Memory
a01
AC
1 ms
128 KB
a02
AC
1 ms
128 KB
a03
AC
1 ms
128 KB
b04
AC
1 ms
128 KB
b05
AC
1 ms
128 KB
b06
AC
1 ms
128 KB
b07
AC
1 ms
128 KB
b08
AC
1 ms
128 KB
b09
AC
1 ms
128 KB
b10
AC
1 ms
128 KB
b11
AC
1 ms
128 KB
b12
AC
1 ms
128 KB