結果

問題 No.395 永遠の17歳
ユーザー dogwood0424
提出日時 2018-02-05 13:56:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 371 bytes
コンパイル時間 2,918 ms
コンパイル使用メモリ 74,456 KB
実行使用メモリ 41,372 KB
最終ジャッジ日時 2024-07-07 14:39:29
合計ジャッジ時間 5,574 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No395 {


	static int judge(int a) {
		int x =8;
		while(x<a) {
			if(a/x==1 && a%x==7) {
				return x;
			}
			else {
				x++;
			}

		}


		return -1;
	}

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

		int ans = judge(a);

		System.out.println(ans)
;
		sc.close();
	}

}
0