Submission #4668718
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll #define REP(i, n) FOR(i, 0, n) #define FOR(i, a, b) for (ll i = a; i < b; i++) #define UM unordered_map #define ALL(a) (a).begin(), (a).end() typedef vector<ll> vi; typedef vector<vector<ll>> vvi; typedef pair<ll, ll> pii; const long long INF = 1LL << 58; struct Edge { ll s, t, d; }; typedef vector<vector<Edge>> Graph; typedef vector<pii> vpii; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } signed main() { int N; cin >> N; vi L; L.resize(2 * N); REP(i, 2 * N) cin >> L[i]; sort(ALL(L)); int ans = 0; REP(i, N) ans += min(L[2 * i], L[2 * i + 1]); cout << ans << endl; //system("pause"); }
Submission Info
Submission Time | |
---|---|
Task | A - BBQ Easy |
User | nekoder |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1005 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 |