Submission #8805448
Source Code Expand
//#pragma GCC target ("avx2") //#pragma GCC optimize ("Ofast") //#pragma GCC optimize ("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long using namespace std; using namespace __gnu_pbds; template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; const int N = (int)(1e6 + 5); const int M = (int)(1e9 + 7); const int INF = (int)(1e18 + 9); const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1}; const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1}; int a[N]; signed main() { ios_base :: sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i <= 2 * n; ++i) cin >> a[i]; sort(a + 1, a + 1 + n * 2); int ret = 0; for (int i = 1; i <= n * 2; i += 2) ret += a[i]; cout << ret; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - BBQ Easy |
User | Lollipop |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 900 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt |
All | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 1 ms | 256 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | AC | 1 ms | 256 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | AC | 1 ms | 256 KB |
01-06.txt | AC | 1 ms | 256 KB |
01-07.txt | AC | 1 ms | 256 KB |
01-08.txt | AC | 1 ms | 256 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |