Submission #23730254
Source Code Expand
Copy
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);
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"); } }
Submission Info
Submission Time | |
---|---|
Task | B - fLIP |
User | tobi00604 |
Language | Java (OpenJDK 11.0.6) |
Score | 200 |
Code Size | 730 Byte |
Status | AC |
Exec Time | 122 ms |
Memory | 35520 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 118 ms | 35364 KB |
02.txt | AC | 122 ms | 35504 KB |
03.txt | AC | 116 ms | 35428 KB |
04.txt | AC | 109 ms | 35476 KB |
05.txt | AC | 117 ms | 35360 KB |
06.txt | AC | 107 ms | 35360 KB |
07.txt | AC | 104 ms | 35324 KB |
08.txt | AC | 106 ms | 35396 KB |
09.txt | AC | 110 ms | 35348 KB |
10.txt | AC | 107 ms | 35424 KB |
11.txt | AC | 101 ms | 35424 KB |
12.txt | AC | 103 ms | 35352 KB |
13.txt | AC | 108 ms | 35388 KB |
14.txt | AC | 109 ms | 35428 KB |
15.txt | AC | 103 ms | 35376 KB |
16.txt | AC | 108 ms | 35484 KB |
17.txt | AC | 104 ms | 35404 KB |
18.txt | AC | 115 ms | 35396 KB |
19.txt | AC | 106 ms | 35328 KB |
20.txt | AC | 104 ms | 35416 KB |
21.txt | AC | 107 ms | 35520 KB |
22.txt | AC | 102 ms | 35392 KB |
23.txt | AC | 105 ms | 35480 KB |
s1.txt | AC | 101 ms | 35388 KB |
s2.txt | AC | 107 ms | 35492 KB |
s3.txt | AC | 108 ms | 35468 KB |
s4.txt | AC | 113 ms | 35232 KB |