結果

問題 No.395 永遠の17歳
ユーザー dogwood0424dogwood0424
提出日時 2018-02-05 13:56:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 1,000 ms
コード長 371 bytes
コンパイル時間 5,352 ms
コンパイル使用メモリ 72,852 KB
実行使用メモリ 39,972 KB
最終ジャッジ日時 2023-09-21 21:20:34
合計ジャッジ時間 7,546 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
39,384 KB
testcase_01 AC 129 ms
39,972 KB
testcase_02 AC 139 ms
39,092 KB
testcase_03 AC 134 ms
39,712 KB
testcase_04 AC 134 ms
39,516 KB
testcase_05 AC 130 ms
39,956 KB
testcase_06 AC 126 ms
39,928 KB
testcase_07 AC 125 ms
39,764 KB
testcase_08 AC 129 ms
39,952 KB
testcase_09 AC 130 ms
39,688 KB
testcase_10 AC 125 ms
39,356 KB
testcase_11 AC 131 ms
39,288 KB
testcase_12 AC 128 ms
39,492 KB
testcase_13 AC 126 ms
39,184 KB
testcase_14 AC 125 ms
39,744 KB
testcase_15 AC 124 ms
39,384 KB
testcase_16 AC 122 ms
39,360 KB
権限があれば一括ダウンロードができます

ソースコード

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