Submission #2298194
Source Code Expand
#include <cstdio> #include <iostream> #include <bitset> #include <cmath> #include <vector> #include <algorithm> #include <queue> using namespace std; typedef long long ll; #define ALL(obj) (obj).begin(), (obj).end() #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) FOR(i,0,n) int main(){ int n,cost; cin >> n; bool used[n]; rep(i,n) used[i] =true; priority_queue<pair<int, pair<int,int> > > q; rep(i,n-1){ rep(j,n-i-1){ int c; cin >> c; q.push(make_pair(c,make_pair(i,j+1))); } } while(!q.empty()){ pair<int, pair<int,int> > tem = q.top(); q.pop(); if(used[tem.second.first] && used[tem.second.second]){ used[tem.second.first]=false; used[tem.second.second]=false; cost += tem.first; } } cout << n << " "; cout << cost << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 特別作戦 |
User | keicut |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 945 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
Set Name | Test Cases |
---|---|
All | 00-sample, 01-maximum, 02-minimum, 03-flat, 50-random-00, 50-random-01, 50-random-02, 50-random-03, 50-random-04, 50-random-05, 50-random-06, 50-random-07, 50-random-08, 50-random-09, 50-random-10, 50-random-11, 50-random-12, 50-random-13, 50-random-14, 50-random-15, 50-random-16, 50-random-17, 50-random-18, 50-random-19 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00-sample | AC | 1 ms | 256 KB |
01-maximum | WA | 1 ms | 256 KB |
02-minimum | WA | 1 ms | 256 KB |
03-flat | WA | 1 ms | 256 KB |
50-random-00 | WA | 1 ms | 256 KB |
50-random-01 | WA | 1 ms | 256 KB |
50-random-02 | WA | 1 ms | 256 KB |
50-random-03 | WA | 1 ms | 256 KB |
50-random-04 | WA | 1 ms | 256 KB |
50-random-05 | WA | 1 ms | 256 KB |
50-random-06 | WA | 1 ms | 256 KB |
50-random-07 | WA | 1 ms | 256 KB |
50-random-08 | WA | 1 ms | 256 KB |
50-random-09 | WA | 1 ms | 256 KB |
50-random-10 | WA | 1 ms | 256 KB |
50-random-11 | WA | 1 ms | 256 KB |
50-random-12 | WA | 1 ms | 256 KB |
50-random-13 | WA | 1 ms | 256 KB |
50-random-14 | WA | 1 ms | 256 KB |
50-random-15 | WA | 1 ms | 256 KB |
50-random-16 | WA | 1 ms | 256 KB |
50-random-17 | WA | 1 ms | 256 KB |
50-random-18 | WA | 1 ms | 256 KB |
50-random-19 | WA | 1 ms | 256 KB |