結果

問題 No.1363 [Zelkova Last Tune] 誰がその最後のベルを鳴らすのか?
ユーザー ks2mks2m
提出日時 2021-01-22 23:36:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 540 ms / 2,000 ms
コード長 1,031 bytes
コンパイル時間 4,785 ms
コンパイル使用メモリ 73,472 KB
実行使用メモリ 60,168 KB
最終ジャッジ日時 2023-08-28 12:09:28
合計ジャッジ時間 5,370 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,424 KB
testcase_01 AC 358 ms
58,640 KB
testcase_02 AC 540 ms
60,168 KB
testcase_03 AC 43 ms
49,424 KB
testcase_04 AC 43 ms
49,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
		PrintWriter pw = new PrintWriter(System.out);
		for (int i = 0; i < t; i++) {
			String[] sa = br.readLine().split(" ");
			int k = Integer.parseInt(sa[0]);
			long z = Long.parseLong(sa[1]);
			long c = Long.parseLong(sa[2]);
			sa = br.readLine().split(" ");
			long[] a = new long[k];
			for (int j = 0; j < k; j++) {
				a[j] = Long.parseLong(sa[j]);
			}
			sa = br.readLine().split(" ");
			long[] p = new long[k];
			for (int j = 0; j < k; j++) {
				p[j] = Long.parseLong(sa[j]);
			}

			long g = 0;
			for (int j = 0; j < k; j++) {
				long b = a[j] % (p[j] + 1);
				g ^= b;
			}

			if (g > 0) {
				c -= g;
			}
			if (z > c) {
				pw.println('Z');
			} else {
				pw.println('C');
			}
		}
		br.close();
		pw.flush();
	}
}
0