結果

問題 No.714 回転寿司屋のシミュレート
ユーザー GrenacheGrenache
提出日時 2018-09-17 09:49:16
言語 Java19
(openjdk 21)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 1,328 bytes
コンパイル時間 4,012 ms
コンパイル使用メモリ 75,652 KB
実行使用メモリ 60,720 KB
最終ジャッジ日時 2023-09-25 09:17:10
合計ジャッジ時間 12,813 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,432 KB
testcase_01 AC 129 ms
55,364 KB
testcase_02 AC 160 ms
55,920 KB
testcase_03 AC 185 ms
56,816 KB
testcase_04 AC 207 ms
57,052 KB
testcase_05 AC 222 ms
59,800 KB
testcase_06 AC 230 ms
59,972 KB
testcase_07 AC 260 ms
60,528 KB
testcase_08 AC 291 ms
60,720 KB
testcase_09 AC 257 ms
60,016 KB
testcase_10 AC 237 ms
60,132 KB
testcase_11 AC 220 ms
59,376 KB
testcase_12 AC 231 ms
59,712 KB
testcase_13 AC 215 ms
59,672 KB
testcase_14 AC 227 ms
59,452 KB
testcase_15 AC 225 ms
58,900 KB
testcase_16 AC 225 ms
59,512 KB
testcase_17 AC 233 ms
59,888 KB
testcase_18 AC 223 ms
59,172 KB
testcase_19 AC 223 ms
59,764 KB
testcase_20 AC 220 ms
59,408 KB
testcase_21 AC 230 ms
59,852 KB
testcase_22 AC 214 ms
59,188 KB
testcase_23 AC 213 ms
59,552 KB
testcase_24 AC 219 ms
59,324 KB
testcase_25 AC 216 ms
59,404 KB
testcase_26 AC 231 ms
59,416 KB
testcase_27 AC 210 ms
59,128 KB
testcase_28 AC 217 ms
59,640 KB
testcase_29 AC 213 ms
59,396 KB
testcase_30 AC 130 ms
55,428 KB
testcase_31 AC 141 ms
56,304 KB
testcase_32 AC 139 ms
56,204 KB
testcase_33 AC 129 ms
55,948 KB
testcase_34 AC 133 ms
56,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder714 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		List<List<String>> order = new ArrayList<>(20);
		for (int i = 0; i < 20; i++) {
			order.add(new ArrayList<>());
		}
		
		for (int i = 0; i < n; i++) {
			int cmd = sc.nextInt();

			out:
			switch (cmd) {
			case 0:
				int nn = sc.nextInt();
				int mm = sc.nextInt();
				for (int j = 0; j < mm; j++) {
					order.get(nn - 1).add(sc.next());
				}
				break;
			case 1:
				String b = sc.next();
				for (int j = 0; j < 20; j++) {
					int index = order.get(j).indexOf(b);
					
					if (index >= 0) {
						order.get(j).remove(index);
						pr.println(j + 1);
						break out;
					}
				}

				pr.println(-1);
				break;
			case 2:
				int c = sc.nextInt();
				order.get(c - 1).clear();
				break;
			}
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0