Submission #1194203
Source Code Expand
#include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <vector> #include <set> #include <map> #include <utility> #include <cstdlib> #include <memory> #include <queue> #include <cassert> #include <cmath> #include <ctime> #include <complex> #include <bitset> #include <fstream> #include <unordered_map> #include <unordered_set> #include <numeric> using namespace std; #define ws ws_____________________ #define y1 y1_____________________ #define y0 y0_____________________ #define left left_________________ #define right right_______________ #define next next_________________ #define prev prev_________________ #define hash hash_________________ #define pb push_back #define fst first #define snd second #define mp make_pair #define sz(C) ((int) (C).size()) #define forn(i, n) for (int i = 0; i < int(n); ++i) #define ford(i, n) for (int i = int(n) - 1; i >= 0; --i) #define all(C) begin(C), end(C) typedef long long ll; typedef unsigned long long ull; typedef unsigned int uint; typedef pair<int,int> pii; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef long double ld; typedef complex<double> cd; #define FILE_NAME "a" const int MAXN = 1e5 + 10; int n; int a[3 * MAXN]; bool read() { if (scanf("%d", &n) < 1) { return 0; } forn(i, 3 * n) { scanf("%d", &a[i]); } return 1; } ll solve() { sort(a, a + (3 * n)); ll ans = 0; for (int i = n; i < 3 * n; i += 2) { ans += a[i]; } return ans; } int main() { #ifdef LOCAL freopen(FILE_NAME ".in", "r", stdin); // freopen(FILE_NAME ".out", "w", stdout); #endif while (read()) { cout << solve() << endl; } #ifdef LOCAL cerr.precision(5); cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl; #endif return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder Group Contest |
User | pavelsavchenkov |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1942 Byte |
Status | AC |
Exec Time | 50 ms |
Memory | 1408 KB |
Compile Error
./Main.cpp: In function ‘bool read()’: ./Main.cpp:67:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &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 | 1408 KB |
07.txt | AC | 27 ms | 1408 KB |
08.txt | AC | 49 ms | 1408 KB |
09.txt | AC | 50 ms | 1408 KB |
10.txt | AC | 49 ms | 1408 KB |