結果

問題 No.395 永遠の17歳
ユーザー shinwisteriashinwisteria
提出日時 2017-04-01 21:33:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 444 bytes
コンパイル時間 4,038 ms
コンパイル使用メモリ 75,204 KB
実行使用メモリ 54,344 KB
最終ジャッジ日時 2024-04-15 09:42:18
合計ジャッジ時間 6,884 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
54,252 KB
testcase_01 AC 137 ms
54,336 KB
testcase_02 AC 138 ms
54,216 KB
testcase_03 AC 139 ms
54,256 KB
testcase_04 AC 138 ms
53,952 KB
testcase_05 AC 139 ms
54,176 KB
testcase_06 AC 139 ms
54,112 KB
testcase_07 AC 139 ms
53,952 KB
testcase_08 AC 140 ms
53,976 KB
testcase_09 AC 139 ms
53,928 KB
testcase_10 AC 138 ms
53,984 KB
testcase_11 AC 136 ms
54,000 KB
testcase_12 AC 139 ms
53,956 KB
testcase_13 AC 138 ms
54,256 KB
testcase_14 AC 136 ms
53,976 KB
testcase_15 AC 135 ms
54,184 KB
testcase_16 AC 137 ms
54,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Forever17 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = new Scanner(System.in);
		int A = s.nextInt(),X = -1;
		s.close();
		for(int i = 1;i <= A-7;i++){
			StringBuilder str = new StringBuilder();
			str.append(A/i);
			str.append(A%i);
			if(str.toString().equals("17")){
				X = i;
				break;
			}
		}
		System.out.println(X);

	}

}
0