Submission #1590802
Source Code Expand
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))
#define iter(v,ite) for(auto ite=(v).begin();ite!=(v).end();ite++)
#define mimunum(v,x) distance((v).begin(),lower_bound((v).begin(),(v).end(),x))
int n;
lli dat[300005];
int main(void){
scanf("%d",&n);
rep(i,n*3){
scanf("%lld",&dat[i]);
}
sort(dat,dat+n*3,greater<lli>());
lli ans=0;
rep(i,n){
ans += dat[i*2+1];
}
printf("%lld\n",ans);
return 0;
}
Submission Info
Submission Time
2017-09-13 16:06:57+0900
Task
A - AtCoder Group Contest
User
vjudge2
Language
C++14 (GCC 5.4.1)
Score
300
Code Size
1082 Byte
Status
AC
Exec Time
49 ms
Memory
2560 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:33:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^
./Main.cpp:35:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld",&dat[i]);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
300 / 300
Status
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
256 KB
00_example_02.txt
AC
1 ms
256 KB
01.txt
AC
1 ms
256 KB
02.txt
AC
1 ms
256 KB
03.txt
AC
1 ms
256 KB
04.txt
AC
1 ms
256 KB
05.txt
AC
4 ms
384 KB
06.txt
AC
40 ms
2560 KB
07.txt
AC
27 ms
2560 KB
08.txt
AC
48 ms
2560 KB
09.txt
AC
49 ms
2560 KB
10.txt
AC
49 ms
2560 KB