結果

問題 No.186 中華風 (Easy)
ユーザー kenkoooo
提出日時 2015-04-19 23:43:44
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 41,852 KB
最終ジャッジ日時 2024-07-04 18:43:57
合計ジャッジ時間 5,752 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 17
権限があれば一括ダウンロードができます

ソースコード

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