Submission #4678066
Source Code Expand
typedef long unsigned int size_t; extern int printf (const char *__restrict __format, ...); extern int scanf (const char *__restrict __format, ...) ; extern int getchar (void); extern int putchar (int __c); int nextInt(){int f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;} char nextChar(){char f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;} short int nextShort(){short f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;} long long int nextLong(){long long int f=0;char s=0;char c=getchar();while((c<48)||(57<c)){if(c==45){s=1;c=getchar();break;}c=getchar();}while((48<=c)&&(c<=57)){f=f*10+(c-48);c=getchar();}return s?-f:f;} void println(){putchar(10);} void print(char *f){while(*f){putchar(*f);f++;}} void printInt(int f){char c[10];if(!f){putchar(48);return;}if(f<0){f=-f;putchar(45);}char i=0;while(f){c[++i]=(f%10)+48;f/=10;}while(i){putchar(c[i--]);}} void printLong(long long int f){char c[19];if(!f){putchar(48);return;}if(f<0){f=-f;putchar(45);}char i=0;while(f){c[++i]=(f%10)+48;f/=10;}while(i){putchar(c[i--]);}} typedef int (*__compar_fn_t) (const void *, const void *); extern void *bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar)__attribute__ ((__nonnull__ (1, 2, 5))) ; extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); int compare_int(const void *a, const void *b){return *(int*)a - *(int*)b;} int compare_char(const void *a, const void *b){return *(char*)a - *(char*)b;} int compare_short(const void *a, const void *b){return *(short*)a - *(short*)b;} int compare_long(const void *a, const void *b){if(*(long long int*)a - *(long long int*)b < 0){return -1;}else if(*(long long int*)a - *(long long int*)b > 0){return 1;}else{return 0;}} char n, i; char l[200]; int ans; int main(){ n = nextChar()<<1; for(i=0; i<n; i++){ l[i] = nextChar(); } qsort(l, n, sizeof(char), compare_char); for(i=0; i<n; i+=2){ ans += l[i]; } printLong(ans); println(); }
Submission Info
Submission Time | |
---|---|
Task | A - BBQ Easy |
User | jannkennshitai |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 2392 Byte |
Status | RE |
Exec Time | 98 ms |
Memory | 128 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt |
All | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 0 ms | 128 KB |
01-02.txt | RE | 96 ms | 128 KB |
01-03.txt | RE | 96 ms | 128 KB |
01-04.txt | AC | 1 ms | 128 KB |
01-05.txt | AC | 1 ms | 128 KB |
01-06.txt | RE | 96 ms | 128 KB |
01-07.txt | RE | 98 ms | 128 KB |
01-08.txt | AC | 1 ms | 128 KB |
sample-01.txt | AC | 1 ms | 128 KB |
sample-02.txt | AC | 1 ms | 128 KB |