Submission #1174219
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include<map> #include <iomanip> #include <time.h> #include <random> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> using namespace std; #define LONG_INF 10000000000000000 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define pay_limit 32 #define change_limit 3 int judge(vector<pair<int, int>> wow, int d) { vector<int> can_do[101]; for (int i = 0;i < 8;++i) { for (int q = d - 1;q > 0;--q) { if (can_do[q].size() != 0 && can_do[q + wow[i].second].size() == 0) { vector<int> woa = can_do[q]; woa.push_back(i); can_do[q + wow[i].second] = woa; } } if (can_do[wow[i].second].size() == 0) { vector<int> gyao; gyao.push_back(i); can_do[wow[i].second] = gyao; } } if (can_do[d].size() != 0) { //完成した return true; } return false; } int main() { iostream::sync_with_stdio(false); for (int i = 0;i < 1000;++i) { vector<int> can_do[101] = {}; int d, t; cin >> d >> t; vector<pair<int, int>> wow; int foo = 0; REP(i, 8) { int tmp; cin >> tmp; foo += tmp; wow.push_back(make_pair(tmp, 0)); } REP(i, 8) { cin >> wow[i].second; } vector<tuple<int, int, int>> gogo; if ((foo < d || wow[7].second > d) || d < pay_limit) { //不可能またはしたくない REP(q, 8) { gogo.push_back(make_tuple(wow[q].first, wow[q].second, q)); } for (int i = 0;i < 8;++i) { if (get<0>(gogo[i]) != get<1>(gogo[i])) { if (get<0>(gogo[i]) <= change_limit) { cout << "change " << get<2>(gogo[i]) + 1 << endl; goto next_go; } cout << "fill " << get<2>(gogo[i]) + 1 << endl; goto next_go; } } cout << "pass" << endl; goto next_go; } for (int i = 0;i < 8;++i) { if (wow[i].second != 0) { for (int q = d - 1;q > 0;--q) { if (can_do[q].size() != 0 && can_do[q + wow[i].second].size() == 0) { vector<int> woa = can_do[q]; woa.push_back(i); can_do[q + wow[i].second] = woa; } } if (can_do[wow[i].second].size() == 0) { vector<int> gyao; gyao.push_back(i); can_do[wow[i].second] = gyao; } } } if (can_do[d].size() != 0) { //完成した cout << "sell " << can_do[d].size(); REP(q, can_do[d].size()) { cout << " " << can_do[d][q] + 1; } cout << endl; goto next_go; } //探索する //fillするとき if (t > 1) { for (int i = 0;i < 8;++i) { vector<pair<int, int>>gyao = wow; gyao[i].second = gyao[i].first; if (judge(gyao, d)) { cout << "fill " << i + 1 << endl; goto next_go; } } //moveするとき for (int i = 0;i < 8;++i) { for (int q = 0;q < 8;++q) { if (i != q) { vector<pair<int, int>> gyao = wow; while (gyao[i].second != 0 && gyao[q].first != gyao[q].second) { gyao[q].second++; gyao[i].second--; } if (judge(gyao, d)) { cout << "move " << i + 1 << " " << q + 1 << endl; goto next_go; } } } } } //不可能またはしたくない REP(q, 8) { gogo.push_back(make_tuple(wow[q].first, wow[q].second, q)); } for (int i = 0;i < 8;++i) { if (get<0>(gogo[i]) != get<1>(gogo[i])) { if (get<0>(gogo[i]) <= change_limit) { cout << "change " << get<2>(gogo[i]) + 1 << endl; goto next_go; } cout << "fill " << get<2>(gogo[i]) + 1 << endl; goto next_go; } } cout << "pass" << endl; goto next_go; next_go:; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 石油王Xの憂鬱 |
User | kotamanegi |
Language | C++14 (Clang 3.8.0) |
Score | 7185907 |
Code Size | 3931 Byte |
Status | AC |
Exec Time | 86 ms |
Memory | 724 KB |
Judge Result
Set Name | test_01 | test_02 | test_03 | test_04 | test_05 | test_06 | test_07 | test_08 | test_09 | test_10 | test_11 | test_12 | test_13 | test_14 | test_15 | test_16 | test_17 | test_18 | test_19 | test_20 | test_21 | test_22 | test_23 | test_24 | test_25 | test_26 | test_27 | test_28 | test_29 | test_30 | test_31 | test_32 | test_33 | test_34 | test_35 | test_36 | test_37 | test_38 | test_39 | test_40 | test_41 | test_42 | test_43 | test_44 | test_45 | test_46 | test_47 | test_48 | test_49 | test_50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 141568 / 417500 | 143537 / 417500 | 151197 / 417500 | 138162 / 417500 | 144683 / 417500 | 142263 / 417500 | 147483 / 417500 | 142371 / 417500 | 144645 / 417500 | 143732 / 417500 | 150949 / 417500 | 136359 / 417500 | 153396 / 417500 | 143854 / 417500 | 129728 / 417500 | 151339 / 417500 | 131716 / 417500 | 138956 / 417500 | 147200 / 417500 | 140235 / 417500 | 149055 / 417500 | 139522 / 417500 | 135740 / 417500 | 145339 / 417500 | 140915 / 417500 | 141693 / 417500 | 145553 / 417500 | 143041 / 417500 | 153401 / 417500 | 150692 / 417500 | 150581 / 417500 | 141133 / 417500 | 139427 / 417500 | 146938 / 417500 | 136631 / 417500 | 143525 / 417500 | 150186 / 417500 | 133209 / 417500 | 146761 / 417500 | 149362 / 417500 | 146137 / 417500 | 142769 / 417500 | 145513 / 417500 | 149052 / 417500 | 149441 / 417500 | 143497 / 417500 | 143969 / 417500 | 134100 / 417500 | 138351 / 417500 | 147001 / 417500 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Status |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set Name | Test Cases |
---|---|
test_01 | subtask_01_01.txt |
test_02 | subtask_01_02.txt |
test_03 | subtask_01_03.txt |
test_04 | subtask_01_04.txt |
test_05 | subtask_01_05.txt |
test_06 | subtask_01_06.txt |
test_07 | subtask_01_07.txt |
test_08 | subtask_01_08.txt |
test_09 | subtask_01_09.txt |
test_10 | subtask_01_10.txt |
test_11 | subtask_01_11.txt |
test_12 | subtask_01_12.txt |
test_13 | subtask_01_13.txt |
test_14 | subtask_01_14.txt |
test_15 | subtask_01_15.txt |
test_16 | subtask_01_16.txt |
test_17 | subtask_01_17.txt |
test_18 | subtask_01_18.txt |
test_19 | subtask_01_19.txt |
test_20 | subtask_01_20.txt |
test_21 | subtask_01_21.txt |
test_22 | subtask_01_22.txt |
test_23 | subtask_01_23.txt |
test_24 | subtask_01_24.txt |
test_25 | subtask_01_25.txt |
test_26 | subtask_01_26.txt |
test_27 | subtask_01_27.txt |
test_28 | subtask_01_28.txt |
test_29 | subtask_01_29.txt |
test_30 | subtask_01_30.txt |
test_31 | subtask_01_31.txt |
test_32 | subtask_01_32.txt |
test_33 | subtask_01_33.txt |
test_34 | subtask_01_34.txt |
test_35 | subtask_01_35.txt |
test_36 | subtask_01_36.txt |
test_37 | subtask_01_37.txt |
test_38 | subtask_01_38.txt |
test_39 | subtask_01_39.txt |
test_40 | subtask_01_40.txt |
test_41 | subtask_01_41.txt |
test_42 | subtask_01_42.txt |
test_43 | subtask_01_43.txt |
test_44 | subtask_01_44.txt |
test_45 | subtask_01_45.txt |
test_46 | subtask_01_46.txt |
test_47 | subtask_01_47.txt |
test_48 | subtask_01_48.txt |
test_49 | subtask_01_49.txt |
test_50 | subtask_01_50.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
subtask_01_01.txt | AC | 67 ms | 720 KB |
subtask_01_02.txt | AC | 80 ms | 592 KB |
subtask_01_03.txt | AC | 77 ms | 716 KB |
subtask_01_04.txt | AC | 82 ms | 724 KB |
subtask_01_05.txt | AC | 78 ms | 720 KB |
subtask_01_06.txt | AC | 82 ms | 724 KB |
subtask_01_07.txt | AC | 78 ms | 720 KB |
subtask_01_08.txt | AC | 79 ms | 720 KB |
subtask_01_09.txt | AC | 82 ms | 724 KB |
subtask_01_10.txt | AC | 76 ms | 716 KB |
subtask_01_11.txt | AC | 73 ms | 720 KB |
subtask_01_12.txt | AC | 83 ms | 716 KB |
subtask_01_13.txt | AC | 78 ms | 720 KB |
subtask_01_14.txt | AC | 76 ms | 716 KB |
subtask_01_15.txt | AC | 85 ms | 712 KB |
subtask_01_16.txt | AC | 78 ms | 720 KB |
subtask_01_17.txt | AC | 86 ms | 716 KB |
subtask_01_18.txt | AC | 74 ms | 716 KB |
subtask_01_19.txt | AC | 81 ms | 720 KB |
subtask_01_20.txt | AC | 76 ms | 724 KB |
subtask_01_21.txt | AC | 80 ms | 724 KB |
subtask_01_22.txt | AC | 76 ms | 720 KB |
subtask_01_23.txt | AC | 70 ms | 724 KB |
subtask_01_24.txt | AC | 78 ms | 720 KB |
subtask_01_25.txt | AC | 72 ms | 720 KB |
subtask_01_26.txt | AC | 76 ms | 720 KB |
subtask_01_27.txt | AC | 75 ms | 716 KB |
subtask_01_28.txt | AC | 82 ms | 720 KB |
subtask_01_29.txt | AC | 78 ms | 724 KB |
subtask_01_30.txt | AC | 76 ms | 716 KB |
subtask_01_31.txt | AC | 82 ms | 592 KB |
subtask_01_32.txt | AC | 78 ms | 720 KB |
subtask_01_33.txt | AC | 76 ms | 720 KB |
subtask_01_34.txt | AC | 78 ms | 716 KB |
subtask_01_35.txt | AC | 81 ms | 720 KB |
subtask_01_36.txt | AC | 80 ms | 720 KB |
subtask_01_37.txt | AC | 77 ms | 724 KB |
subtask_01_38.txt | AC | 76 ms | 720 KB |
subtask_01_39.txt | AC | 77 ms | 592 KB |
subtask_01_40.txt | AC | 78 ms | 592 KB |
subtask_01_41.txt | AC | 70 ms | 720 KB |
subtask_01_42.txt | AC | 76 ms | 720 KB |
subtask_01_43.txt | AC | 76 ms | 716 KB |
subtask_01_44.txt | AC | 80 ms | 720 KB |
subtask_01_45.txt | AC | 83 ms | 720 KB |
subtask_01_46.txt | AC | 78 ms | 724 KB |
subtask_01_47.txt | AC | 84 ms | 720 KB |
subtask_01_48.txt | AC | 72 ms | 716 KB |
subtask_01_49.txt | AC | 72 ms | 716 KB |
subtask_01_50.txt | AC | 78 ms | 720 KB |