Submission #1173204
Source Code Expand
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Globalization; using System.Diagnostics; class Myon { public Myon() { } public static int Main() { new Myon().calc(); return 0; } Scanner cin; int D; int T; int[] C; int[] A; const int MaxTurn = 1000; const int MaxBox = 8; //A問題 public void calc() { cin = new Scanner(); for (int i = 0; i < MaxTurn; i++) { D = cin.nextInt(); T = cin.nextInt(); C = new int[MaxBox]; A = new int[MaxBox]; for (int j = 0; j < MaxBox; j++) { C[j] = cin.nextInt(); } for (int j = 0; j < MaxBox; j++) { A[j] = cin.nextInt(); } int[] sell = sellcheck(); if(sell.Length > 0) { Console.WriteLine("sell {0} {1}", sell.Length, string.Join(" ", sell)); continue; } bool cflag = false; for (int j = 0; j < MaxBox; j++) { if(A[j] == 0) { Console.WriteLine("fill {0}", j + 1); cflag = true; break; } } if (cflag) continue; Console.WriteLine("pass"); } } int[] pre; const int M = 100; int[] sellcheck() { pre = new int[M]; for (int i = 0; i < M; i++) { pre[i] = -1; } pre[0] = 0; for (int i = 0; i < MaxBox; i++) { if (A[i] == 0) continue; for (int j = M - 1; j >= 0; j--) { if (pre[j] != -1 && pre[j+A[i]] == -1) pre[j + A[i]] = i; } } if(pre[D] == -1) { return new int[0]; } List<int> ans = new List<int>(); int now = D; while(now != 0) { ans.Add(pre[now] + 1); now -= A[pre[now]]; } return ans.ToArray(); } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string next() { if (i < s.Length) return s[i++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return s[i++]; } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } }
Submission Info
Submission Time | |
---|---|
Task | A - 石油王Xの憂鬱 |
User | chokudai |
Language | C# (Mono 4.6.2.0) |
Score | 5495632 |
Code Size | 3049 Byte |
Status | AC |
Exec Time | 85 ms |
Memory | 13608 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 | 109303 / 417500 | 108174 / 417500 | 103812 / 417500 | 112583 / 417500 | 104211 / 417500 | 118331 / 417500 | 114730 / 417500 | 106431 / 417500 | 110482 / 417500 | 115343 / 417500 | 107905 / 417500 | 111243 / 417500 | 120054 / 417500 | 114454 / 417500 | 107795 / 417500 | 110360 / 417500 | 113069 / 417500 | 112699 / 417500 | 112298 / 417500 | 111912 / 417500 | 112648 / 417500 | 106816 / 417500 | 100333 / 417500 | 102246 / 417500 | 114970 / 417500 | 108129 / 417500 | 112433 / 417500 | 113674 / 417500 | 119297 / 417500 | 106096 / 417500 | 118438 / 417500 | 107552 / 417500 | 106853 / 417500 | 112162 / 417500 | 110271 / 417500 | 107551 / 417500 | 113966 / 417500 | 110365 / 417500 | 106491 / 417500 | 108863 / 417500 | 113850 / 417500 | 106465 / 417500 | 110986 / 417500 | 103416 / 417500 | 105528 / 417500 | 106384 / 417500 | 104524 / 417500 | 102732 / 417500 | 107971 / 417500 | 109433 / 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 | 85 ms | 11936 KB |
subtask_01_02.txt | AC | 81 ms | 11428 KB |
subtask_01_03.txt | AC | 76 ms | 9508 KB |
subtask_01_04.txt | AC | 80 ms | 11556 KB |
subtask_01_05.txt | AC | 82 ms | 11560 KB |
subtask_01_06.txt | AC | 82 ms | 9508 KB |
subtask_01_07.txt | AC | 81 ms | 13604 KB |
subtask_01_08.txt | AC | 81 ms | 11428 KB |
subtask_01_09.txt | AC | 82 ms | 11556 KB |
subtask_01_10.txt | AC | 80 ms | 13476 KB |
subtask_01_11.txt | AC | 77 ms | 11560 KB |
subtask_01_12.txt | AC | 81 ms | 13604 KB |
subtask_01_13.txt | AC | 81 ms | 11428 KB |
subtask_01_14.txt | AC | 81 ms | 11556 KB |
subtask_01_15.txt | AC | 82 ms | 13600 KB |
subtask_01_16.txt | AC | 81 ms | 11552 KB |
subtask_01_17.txt | AC | 80 ms | 9504 KB |
subtask_01_18.txt | AC | 77 ms | 11428 KB |
subtask_01_19.txt | AC | 80 ms | 11428 KB |
subtask_01_20.txt | AC | 81 ms | 11432 KB |
subtask_01_21.txt | AC | 80 ms | 9508 KB |
subtask_01_22.txt | AC | 81 ms | 11556 KB |
subtask_01_23.txt | AC | 80 ms | 11428 KB |
subtask_01_24.txt | AC | 78 ms | 11428 KB |
subtask_01_25.txt | AC | 79 ms | 11556 KB |
subtask_01_26.txt | AC | 82 ms | 13608 KB |
subtask_01_27.txt | AC | 80 ms | 13604 KB |
subtask_01_28.txt | AC | 79 ms | 11556 KB |
subtask_01_29.txt | AC | 80 ms | 11548 KB |
subtask_01_30.txt | AC | 81 ms | 13480 KB |
subtask_01_31.txt | AC | 80 ms | 11552 KB |
subtask_01_32.txt | AC | 79 ms | 11556 KB |
subtask_01_33.txt | AC | 80 ms | 9504 KB |
subtask_01_34.txt | AC | 77 ms | 9508 KB |
subtask_01_35.txt | AC | 82 ms | 13604 KB |
subtask_01_36.txt | AC | 80 ms | 11428 KB |
subtask_01_37.txt | AC | 79 ms | 11428 KB |
subtask_01_38.txt | AC | 82 ms | 9512 KB |
subtask_01_39.txt | AC | 80 ms | 11556 KB |
subtask_01_40.txt | AC | 76 ms | 11428 KB |
subtask_01_41.txt | AC | 79 ms | 9508 KB |
subtask_01_42.txt | AC | 80 ms | 11560 KB |
subtask_01_43.txt | AC | 82 ms | 13476 KB |
subtask_01_44.txt | AC | 79 ms | 11556 KB |
subtask_01_45.txt | AC | 82 ms | 11556 KB |
subtask_01_46.txt | AC | 79 ms | 11428 KB |
subtask_01_47.txt | AC | 79 ms | 11428 KB |
subtask_01_48.txt | AC | 81 ms | 11556 KB |
subtask_01_49.txt | AC | 78 ms | 11424 KB |
subtask_01_50.txt | AC | 82 ms | 13472 KB |