結果
問題 |
No.1363 [Zelkova Last Tune] 誰がその最後のベルを鳴らすのか?
|
ユーザー |
![]() |
提出日時 | 2021-01-22 23:35:35 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,035 bytes |
コンパイル時間 | 2,579 ms |
コンパイル使用メモリ | 77,480 KB |
実行使用メモリ | 50,760 KB |
最終ジャッジ日時 | 2024-12-28 08:43:12 |
合計ジャッジ時間 | 3,646 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 RE * 2 |
ソースコード
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] = Integer.parseInt(sa[j]); } sa = br.readLine().split(" "); long[] p = new long[k]; for (int j = 0; j < k; j++) { p[j] = Integer.parseInt(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(); } }