提出 #23730254
ソースコード 拡げる
import java.util.*;
public class Main {
public static void main(String[] args) {
// 入力
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int m = Integer.parseInt(sc.next());
int k = Integer.parseInt(sc.next());
// ・n行のうち何行反転したか
// ・m列のうち何列反転したか
// 上記の組み合わせの全探索 O(1000^2)
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= m; j++) {
int score = 0;
score += (n - i) * j;
score += (m - j) * i;
// System.out.println(i + " " + j + " " + score);
if (score == k) {
System.out.println("Yes");
return;
}
}
}
System.out.println("No");
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - fLIP |
| ユーザ | tobi00604 |
| 言語 | Java (OpenJDK 11.0.6) |
| 得点 | 200 |
| コード長 | 730 Byte |
| 結果 | AC |
| 実行時間 | 122 ms |
| メモリ | 35520 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt, s4.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, s1.txt, s2.txt, s3.txt, s4.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 118 ms | 35364 KiB |
| 02.txt | AC | 122 ms | 35504 KiB |
| 03.txt | AC | 116 ms | 35428 KiB |
| 04.txt | AC | 109 ms | 35476 KiB |
| 05.txt | AC | 117 ms | 35360 KiB |
| 06.txt | AC | 107 ms | 35360 KiB |
| 07.txt | AC | 104 ms | 35324 KiB |
| 08.txt | AC | 106 ms | 35396 KiB |
| 09.txt | AC | 110 ms | 35348 KiB |
| 10.txt | AC | 107 ms | 35424 KiB |
| 11.txt | AC | 101 ms | 35424 KiB |
| 12.txt | AC | 103 ms | 35352 KiB |
| 13.txt | AC | 108 ms | 35388 KiB |
| 14.txt | AC | 109 ms | 35428 KiB |
| 15.txt | AC | 103 ms | 35376 KiB |
| 16.txt | AC | 108 ms | 35484 KiB |
| 17.txt | AC | 104 ms | 35404 KiB |
| 18.txt | AC | 115 ms | 35396 KiB |
| 19.txt | AC | 106 ms | 35328 KiB |
| 20.txt | AC | 104 ms | 35416 KiB |
| 21.txt | AC | 107 ms | 35520 KiB |
| 22.txt | AC | 102 ms | 35392 KiB |
| 23.txt | AC | 105 ms | 35480 KiB |
| s1.txt | AC | 101 ms | 35388 KiB |
| s2.txt | AC | 107 ms | 35492 KiB |
| s3.txt | AC | 108 ms | 35468 KiB |
| s4.txt | AC | 113 ms | 35232 KiB |