結果
| 問題 | No.2063 ±2^k operations (easy) |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2022-09-02 21:57:30 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 172 ms / 2,000 ms |
| コード長 | 621 bytes |
| 記録 | |
| コンパイル時間 | 2,947 ms |
| コンパイル使用メモリ | 81,992 KB |
| 実行使用メモリ | 45,564 KB |
| 最終ジャッジ日時 | 2026-05-11 07:16:49 |
| 合計ジャッジ時間 | 6,339 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
char[] n = sc.next().toCharArray();
sc.close();
int[] c = new int[2];
for (int i = 0; i < n.length; i++) {
c[n[i] - '0']++;
}
if (c[1] == 2) {
System.out.println("Yes");
} else if (c[1] > 2) {
boolean flg = true;
for (int i = 0; i < n.length; i++) {
if (n[i] == '0') {
flg = false;
} else if (!flg) {
System.out.println("No");
return;
}
}
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
ks2m