結果
問題 | No.1456 Range Xor |
ユーザー | Asahi |
提出日時 | 2023-02-06 23:07:52 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 925 bytes |
コンパイル時間 | 2,164 ms |
コンパイル使用メモリ | 71,840 KB |
実行使用メモリ | 65,092 KB |
最終ジャッジ日時 | 2023-09-18 08:47:00 |
合計ジャッジ時間 | 27,317 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 126 ms
55,800 KB |
testcase_01 | AC | 129 ms
55,892 KB |
testcase_02 | AC | 129 ms
55,788 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 325 ms
60,764 KB |
testcase_12 | AC | 258 ms
59,400 KB |
testcase_13 | AC | 419 ms
60,864 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 481 ms
60,784 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 301 ms
59,992 KB |
testcase_25 | AC | 379 ms
60,276 KB |
testcase_26 | AC | 458 ms
60,932 KB |
testcase_27 | WA | - |
testcase_28 | AC | 359 ms
60,968 KB |
testcase_29 | AC | 555 ms
60,380 KB |
testcase_30 | WA | - |
testcase_31 | AC | 357 ms
60,364 KB |
testcase_32 | AC | 339 ms
60,188 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | AC | 577 ms
61,008 KB |
testcase_38 | AC | 303 ms
60,512 KB |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | AC | 198 ms
57,748 KB |
testcase_42 | AC | 283 ms
59,908 KB |
testcase_43 | AC | 127 ms
55,304 KB |
testcase_44 | WA | - |
testcase_45 | AC | 127 ms
55,668 KB |
testcase_46 | WA | - |
testcase_47 | AC | 128 ms
55,540 KB |
testcase_48 | AC | 127 ms
55,668 KB |
ソースコード
import java.util.*; import java.io.*; import java.math.*; // import java.util.stream.Stream; class Main{ static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static PrintWriter output = new PrintWriter(System.out); static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws IOException{ int n = sc.nextInt(); long K = sc.nextLong(); long [] A = new long[n]; for(int i=0;i<n;i++) A[i] = sc.nextLong(); int r = 0; long sum = 0; boolean ok = false; for(int l = 0; l < n ; l ++) { while( r < n && sum < K) { sum += A[r]; if(sum == K) ok = true; r++; } sum -= A[l]; if(l == r) r++; } output.print(ok?"Yes":"No"); output.flush(); } }