# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
81634 | 2018-10-25T16:18:59 Z | xiaowuc1 | Akcija (COCI15_akcija) | C++14 | 32 ms | 3512 KB |
#include <bits/stdc++.h> /* unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count(); mt19937 g1.seed(seed1); ios_base::sync_with_stdio(false); cin.tie(NULL); */ using namespace std; const double PI = 2 * acos(0); typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<int, ll> pill; typedef pair<ll, ll> pll; typedef long double ld; typedef vector<vector<ll>> matrix; int main() { int n; scanf("%d", &n); vector<int> v; for(int i = 0; i < n; i++) { int t; scanf("%d", &t); v.push_back(t); } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); ll ret = 0; for(int i = 0; i < n; i++) { if(i%3==2) continue; ret += v[i]; } printf("%lld\n", ret); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 512 KB | Output is correct |
3 | Correct | 2 ms | 560 KB | Output is correct |
4 | Correct | 2 ms | 560 KB | Output is correct |
5 | Correct | 2 ms | 560 KB | Output is correct |
6 | Correct | 21 ms | 1704 KB | Output is correct |
7 | Correct | 23 ms | 1976 KB | Output is correct |
8 | Correct | 15 ms | 2424 KB | Output is correct |
9 | Correct | 32 ms | 2944 KB | Output is correct |
10 | Correct | 26 ms | 3512 KB | Output is correct |