結果

問題 No.1312 Snake Eyes
ユーザー さかぽんさかぽん
提出日時 2020-12-15 10:53:27
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 107,684 KB
実行使用メモリ 23,796 KB
最終ジャッジ日時 2023-10-20 05:52:29
合計ジャッジ時間 6,931 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
23,712 KB
testcase_01 AC 23 ms
23,712 KB
testcase_02 AC 23 ms
23,712 KB
testcase_03 AC 23 ms
23,712 KB
testcase_04 AC 23 ms
23,712 KB
testcase_05 AC 23 ms
23,712 KB
testcase_06 AC 23 ms
23,712 KB
testcase_07 AC 23 ms
23,712 KB
testcase_08 AC 22 ms
23,712 KB
testcase_09 AC 22 ms
23,712 KB
testcase_10 AC 22 ms
23,712 KB
testcase_11 AC 23 ms
23,712 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 22 ms
23,712 KB
testcase_16 WA -
testcase_17 AC 23 ms
23,712 KB
testcase_18 WA -
testcase_19 AC 22 ms
23,712 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 22 ms
23,712 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 22 ms
23,712 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 22 ms
23,712 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 24 ms
23,712 KB
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
testcase_63 AC 22 ms
23,712 KB
testcase_64 AC 23 ms
23,712 KB
testcase_65 AC 23 ms
23,712 KB
testcase_66 WA -
testcase_67 AC 23 ms
23,712 KB
testcase_68 AC 23 ms
23,712 KB
testcase_69 AC 23 ms
23,712 KB
testcase_70 AC 23 ms
23,712 KB
testcase_71 AC 23 ms
23,712 KB
testcase_72 AC 23 ms
23,712 KB
testcase_73 AC 23 ms
23,712 KB
testcase_74 AC 23 ms
23,712 KB
testcase_75 AC 22 ms
23,712 KB
testcase_76 RE -
testcase_77 RE -
testcase_78 RE -
testcase_79 AC 23 ms
23,712 KB
testcase_80 RE -
testcase_81 RE -
testcase_82 RE -
testcase_83 RE -
testcase_84 RE -
testcase_85 AC 23 ms
23,712 KB
testcase_86 AC 22 ms
23,712 KB
testcase_87 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class I
{
	static void Main() => Console.WriteLine(Solve());
	static object Solve()
	{
		var n = long.Parse(Console.ReadLine());
		if (n <= 2) return n + 1;

		for (long p = 2; p * p <= n + 1; p++)
		{
			for (long d = p; d <= p * (n + 1); d *= p)
			{
				var q = (d - 1) / (p - 1);
				if (n % q == 0 && 0 < n / q && n / q < p) return p;
			}
		}
		return n - 1;
	}
}
0