Submission #1194063


Source Code Expand

//IIT Kanpur FacelessMen India
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( gg,itit )  for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define mp make_pair
#define pb push_back
#define all(s) s.begin(),s.end()
#define present(c,x) ((c).find(x) != (c).end())
const double EPS = 1e-8;
const int mod = 1e9+7;
const int N = 1e6+10;
const ll INF = 1e18;

//#define DEBUG
ll power(ll x,ll y){
  ll t=1;
  while(y>0){
    if(y%2) y-=1,t=t*x%mod;
    else y/=2,x=x*x%mod;
  }
  return t;
}
#ifdef DEBUG
#define dprintf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#else
#define dprintf(fmt,...)
#endif

vector<int> arr;
int main(){
  // freopen("product.in","r",stdin);
  // freopen("product.out","w",stdout);
  int n; scanf("%d",&n);
  REP(i,3*n){
    int x; scanf("%d",&x); arr.pb(x);
  }
  sort(all(arr));
  reverse(all(arr));
  ll ans = 0;
  REP(i,n){
    ans+=arr[i*2+1];
  }
  printf("%lld\n",ans);
  return 0;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User alecsyde
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1279 Byte
Status AC
Exec Time 51 ms
Memory 2420 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:43:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   int n; scanf("%d",&n);
                        ^
./Main.cpp:45:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     int x; scanf("%d",&x); arr.pb(x);
                          ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 12
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 43 ms 2420 KB
07.txt AC 31 ms 2420 KB
08.txt AC 51 ms 2420 KB
09.txt AC 51 ms 2420 KB
10.txt AC 51 ms 2420 KB