結果
問題 | No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい |
ユーザー | sekiya9311 |
提出日時 | 2016-10-14 23:45:34 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 4,706 bytes |
コンパイル時間 | 1,708 ms |
コンパイル使用メモリ | 143,888 KB |
実行使用メモリ | 141,440 KB |
最終ジャッジ日時 | 2024-11-22 07:06:36 |
合計ジャッジ時間 | 175,319 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | TLE | - |
testcase_02 | TLE | - |
testcase_03 | TLE | - |
testcase_04 | TLE | - |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | TLE | - |
testcase_08 | TLE | - |
testcase_09 | TLE | - |
testcase_10 | TLE | - |
testcase_11 | TLE | - |
testcase_12 | TLE | - |
testcase_13 | TLE | - |
testcase_14 | TLE | - |
testcase_15 | AC | 1,714 ms
84,096 KB |
testcase_16 | TLE | - |
testcase_17 | TLE | - |
testcase_18 | TLE | - |
testcase_19 | TLE | - |
testcase_20 | TLE | - |
testcase_21 | TLE | - |
testcase_22 | TLE | - |
testcase_23 | TLE | - |
testcase_24 | TLE | - |
testcase_25 | TLE | - |
testcase_26 | TLE | - |
testcase_27 | TLE | - |
testcase_28 | TLE | - |
testcase_29 | TLE | - |
testcase_30 | AC | 23 ms
60,288 KB |
testcase_31 | AC | 23 ms
131,208 KB |
testcase_32 | TLE | - |
testcase_33 | TLE | - |
testcase_34 | TLE | - |
testcase_35 | WA | - |
testcase_36 | AC | 22 ms
54,912 KB |
testcase_37 | AC | 22 ms
55,040 KB |
testcase_38 | AC | 21 ms
54,912 KB |
testcase_39 | AC | 32 ms
55,300 KB |
testcase_40 | AC | 24 ms
55,068 KB |
testcase_41 | AC | 77 ms
57,088 KB |
testcase_42 | AC | 526 ms
57,472 KB |
testcase_43 | AC | 774 ms
57,452 KB |
testcase_44 | AC | 101 ms
57,068 KB |
testcase_45 | AC | 26 ms
55,296 KB |
testcase_46 | AC | 270 ms
57,184 KB |
testcase_47 | AC | 2,281 ms
141,440 KB |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:98:23: warning: 'n' is used uninitialized [-Wuninitialized] 98 | int s,p,u,n; | ^ main.cpp:98:21: warning: 'u' is used uninitialized [-Wuninitialized] 98 | int s,p,u,n; | ^ main.cpp:98:19: warning: 'p' is used uninitialized [-Wuninitialized] 98 | int s,p,u,n; | ^ main.cpp:98:17: warning: 's' is used uninitialized [-Wuninitialized] 98 | int s,p,u,n; | ^
ソースコード
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <cassert> #include <cstddef> #include <iomanip> #include <numeric> #include <tuple> #include <sstream> #include <fstream> #include <random> #define REP(i, n) for (int (i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++) #define RREP(i, a) for (int (i) = (a) - 1; (i) >= 0; (i)--) #define FORR(i, a, b) for (int (i) = (a) - 1; (i) >= (b); (i)--) #define PI acos(-1.0) #define DEBUG(C) cerr << C << endl; #define VI vector <int> #define VII vector <VI> #define VL vector <LL> #define VLL vector <VL> #define VD vector <double> #define VDD vector <VD> #define PII pair <int, int> #define PDD pair <double, double> #define PLL pair <LL, LL> #define VPII vector <PII> #define ALL(a) (a).begin(), (a).end() #define SORT(a) sort(ALL(a)) #define REVERSE(a) reverse(ALL(a)) #define MP make_pair #define EB emplace_back #define FORE(a, b) for (auto &&a : b) #define FIND(s, n) (s.find(n) != s.end()) using namespace std; typedef long long LL; typedef unsigned long long ULL; const int INF = 1e9; const int MOD = INF + 7; const LL LLINF = 1e18; int N, K; vector<tuple<int, int, int, int>> SPU; //解いた問題で云々 //map<int, set<tuple<int, int, int, int>>> ac; //(正答数, SPU) //map<int, set<tuple<int, int, int, int>>> school; //(学校, SPU) //map<int, set<tuple<int, int, int, int>>> pena; //(ペナ数, SPU) vector<set<tuple<int, int, int, int>>> ac, school, pena; vector<int> sccnt; set<int> used; int main(void) { cin >> N >> K; SPU.resize(N); ac.resize(12); school.resize((int)1e5 + 10); pena.resize((int)1e6 + 10); sccnt.resize(N, 0); REP(i, N) { int s, p, u; //cin >> s >> p >> u; scanf("%d%d%d", &s, &p, &u); auto tt = make_tuple(s, p, u, i); SPU[i] = tt; ac[s].emplace(tt); school[u].emplace(tt); pena[p].emplace(tt); } while(ac.back().size() == 0) ac.pop_back(); SORT(SPU);REVERSE(SPU); REP(_, K) { auto itr = ac.end(); itr--; if ((*itr).size() == 0) { ac.erase(itr); itr = ac.end(); itr--; } if ((*itr).size() == 1) { int s,p,u,n; FORE(el, (*itr)) { //cout << get<3>(el) << endl; printf("%d\n", get<3>(el)); //DEBUG("AC数") tie(s, p, u, n) = el; } sccnt[u]++; ac[s].erase(make_tuple(s, p, u, n)); school[u].erase(make_tuple(s, p, u, n)); pena[p].erase(make_tuple(s, p, u, n)); } else { //学校からの突破数で比較 int s, p, u, n; int mokuhyonum = INF; set<tuple<int, int, int, int>> se; FORE(el, (*itr)) { tie(s, p, u, n) = el; if (mokuhyonum > sccnt[u]) { se.clear(); se.insert(el); mokuhyonum = sccnt[u]; } else if (mokuhyonum == sccnt[u]) { se.insert(el); } } if (se.size() == 1) { FORE(el, se) { //cout << get<3>(el) << endl; printf("%d\n", get<3>(el)); //DEBUG("school数") tie(s, p, u, n) = el; sccnt[u]++; ac[s].erase(make_tuple(s, p, u, n)); school[u].erase(make_tuple(s, p, u, n)); pena[p].erase(make_tuple(s, p, u, n)); } } else { //ペナ数で比較 int s, p, u, n; int minpena = INF; tuple<int, int, int, int> ans; FORE(el, se) { tie(s, p, u, n) = el; if (minpena > p) { minpena = p; ans = el; } } //cout << get<3>(ans) << endl; printf("%d\n", get<3>(ans)); //DEBUG("pena数") tie(s, p, u, n) = ans; sccnt[u]++; ac[s].erase(make_tuple(s, p, u, n)); school[u].erase(make_tuple(s, p, u, n)); pena[p].erase(make_tuple(s, p, u, n)); } } } }