Submission #1195348


Source Code Expand

#include <stdio.h>
#include <stdlib.h>

#define int long long

int main()
{
  int n, i, j, t, ans, mp;
  scanf("%lld", &n);
  int *a = (int *)malloc(sizeof(int) * n * 3);

  for(i=0; i<n*3; i++){
    scanf("%lld", a+i);
  }

  for(i=0; i<3*n-1; i++){
    mp = i;
    for(j=i; j<3*n; j++){
      if(a[mp] < a[j]) mp = j;
    }
    t=a[i];
    a[i] = a[mp];
    a[mp] = t;
  }

  ans = 0;
  for(i=1; i<n*2; i+=2){
    ans += a[i];
  }

  printf("%lld\n", ans);
  return 0;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User casgePZL
Language C (GCC 5.4.1)
Score 0
Code Size 504 Byte
Status TLE
Exec Time 2103 ms
Memory 2560 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:9:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld", &n);
   ^
./Main.c:13:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld", a+i);
     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 7
TLE × 5
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 1 ms 128 KB
00_example_02.txt AC 1 ms 128 KB
01.txt AC 1 ms 128 KB
02.txt AC 1 ms 128 KB
03.txt AC 1 ms 128 KB
04.txt AC 1 ms 128 KB
05.txt AC 122 ms 256 KB
06.txt TLE 2103 ms 2560 KB
07.txt TLE 2103 ms 2560 KB
08.txt TLE 2103 ms 2560 KB
09.txt TLE 2103 ms 2432 KB
10.txt TLE 2103 ms 2560 KB