結果
問題 | No.216 FAC |
ユーザー | jimano |
提出日時 | 2018-01-22 19:04:54 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 824 bytes |
コンパイル時間 | 4,549 ms |
コンパイル使用メモリ | 71,324 KB |
実行使用メモリ | 51,748 KB |
最終ジャッジ日時 | 2023-08-26 21:59:06 |
合計ジャッジ時間 | 6,143 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | AC | 42 ms
49,404 KB |
testcase_07 | AC | 42 ms
49,824 KB |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
testcase_26 | AC | 41 ms
49,432 KB |
ソースコード
package me.yukicoder.lv1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No0216 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { int cnt = Integer.parseInt(br.readLine()); String[] a = br.readLine().split(""); String[] b = br.readLine().split(""); int[] score = new int[cnt]; int[] cntSolved = new int[cnt]; int sumScore = 0; int kScore = 0; for (int i = 0; i < cnt; i++) { score[i] = Integer.parseInt(a[i]); cntSolved[i] = Integer.parseInt(b[i]); sumScore += score[i]; kScore += cntSolved[i] == 0 ? score[i] : 0; } System.out.println((sumScore / 2) <= kScore ? "YES" : "NO"); } catch (IOException e) { e.printStackTrace(); } } }