結果

問題 No.186 中華風 (Easy)
ユーザー kenkooookenkoooo
提出日時 2015-04-19 23:43:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 2,057 ms
コンパイル使用メモリ 71,676 KB
実行使用メモリ 59,664 KB
最終ジャッジ日時 2023-09-18 01:48:09
合計ジャッジ時間 6,083 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,572 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 130 ms
55,832 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 135 ms
55,644 KB
testcase_20 AC 131 ms
55,568 KB
testcase_21 AC 130 ms
55,660 KB
testcase_22 AC 133 ms
55,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] X = new int[3];
		int[] Y = new int[3];

		for (int i = 0; i < 3; i++) {
			X[i] = sc.nextInt();
			Y[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < 100000; i++) {
			boolean check = true;
			for (int j = 0; j < 3; j++) {
				if (i % Y[j] != X[j]) {
					check = false;
					break;
				}
			}
			if (check) {
				System.out.print(i);
				return;
			}
		}
		System.out.println(-1);

	}

}
0