結果

問題 No.714 回転寿司屋のシミュレート
ユーザー takeya_okinotakeya_okino
提出日時 2019-09-29 11:05:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 373 ms / 2,000 ms
コード長 919 bytes
コンパイル時間 2,262 ms
コンパイル使用メモリ 78,128 KB
実行使用メモリ 59,436 KB
最終ジャッジ日時 2024-04-14 07:12:21
合計ジャッジ時間 12,464 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
54,012 KB
testcase_01 AC 150 ms
54,328 KB
testcase_02 AC 181 ms
54,312 KB
testcase_03 AC 212 ms
54,544 KB
testcase_04 AC 240 ms
55,100 KB
testcase_05 AC 254 ms
57,528 KB
testcase_06 AC 295 ms
58,384 KB
testcase_07 AC 322 ms
58,804 KB
testcase_08 AC 373 ms
59,348 KB
testcase_09 AC 292 ms
58,460 KB
testcase_10 AC 291 ms
58,320 KB
testcase_11 AC 289 ms
57,704 KB
testcase_12 AC 287 ms
57,676 KB
testcase_13 AC 288 ms
57,564 KB
testcase_14 AC 277 ms
57,516 KB
testcase_15 AC 274 ms
57,936 KB
testcase_16 AC 285 ms
57,700 KB
testcase_17 AC 285 ms
58,068 KB
testcase_18 AC 277 ms
57,720 KB
testcase_19 AC 284 ms
57,744 KB
testcase_20 AC 283 ms
58,012 KB
testcase_21 AC 293 ms
57,796 KB
testcase_22 AC 267 ms
57,740 KB
testcase_23 AC 258 ms
57,464 KB
testcase_24 AC 247 ms
57,700 KB
testcase_25 AC 257 ms
57,736 KB
testcase_26 AC 262 ms
59,436 KB
testcase_27 AC 267 ms
57,600 KB
testcase_28 AC 251 ms
57,288 KB
testcase_29 AC 270 ms
57,632 KB
testcase_30 AC 148 ms
54,120 KB
testcase_31 AC 165 ms
54,428 KB
testcase_32 AC 163 ms
54,256 KB
testcase_33 AC 148 ms
54,340 KB
testcase_34 AC 150 ms
54,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList[] list = new ArrayList[21];
    for(int i = 0; i < 21; i++) {
      list[i] = new ArrayList<String>();
    }
    for(int i = 0; i < n; i++) {
      int d = sc.nextInt();
      if(d == 0) {
        int seki = sc.nextInt();
        int m = sc.nextInt();
        for(int j = 0; j < m; j++) {
          String a = sc.next();
          list[seki].add(a);
        }
      } else if(d == 1) {
        String neta = sc.next();
        int ans = -1;
        for(int j = 1; j < 21; j++) {
          if(list[j].contains(neta)) {
            ans = j;
            list[j].remove(neta);
            break;
          }
        }
        System.out.println(ans);
      } else {
        int c = sc.nextInt();
        list[c] = new ArrayList<String>();
      }
    }
  }
}
0