結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-22 19:04:54 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 824 bytes |
| コンパイル時間 | 4,053 ms |
| コンパイル使用メモリ | 73,432 KB |
| 実行使用メモリ | 37,360 KB |
| 最終ジャッジ日時 | 2024-12-26 00:56:12 |
| 合計ジャッジ時間 | 6,661 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | AC * 3 RE * 21 |
ソースコード
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();
}
}
}