Submission #1194012
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))
// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD
// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;
int n;
ll a[352521];
int main(){
scanf("%d",&n);
REP(i,3*n)scanf("%lld",a+i);
sort(a,a+3*n);
ll ans = 0;
REP(i,n)ans += a[3*n-2-2*i];
cout<<ans<<endl;
return 0;
}
Submission Info
Submission Time
2017-04-01 21:02:02+0900
Task
A - AtCoder Group Contest
User
rickytheta
Language
C++14 (GCC 5.4.1)
Score
300
Code Size
1059 Byte
Status
AC
Exec Time
61 ms
Memory
2560 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:38:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^
./Main.cpp:39:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
REP(i,3*n)scanf("%lld",a+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
41 ms
2560 KB
07.txt
AC
28 ms
2560 KB
08.txt
AC
50 ms
2560 KB
09.txt
AC
61 ms
2560 KB
10.txt
AC
50 ms
2560 KB