結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー YoiTakaYoiTaka
提出日時 2017-03-03 22:54:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 2,109 ms
コンパイル使用メモリ 104,344 KB
実行使用メモリ 22,800 KB
最終ジャッジ日時 2023-09-04 06:32:38
合計ジャッジ時間 3,864 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,796 KB
testcase_01 AC 56 ms
20,696 KB
testcase_02 AC 56 ms
20,820 KB
testcase_03 AC 56 ms
20,840 KB
testcase_04 AC 56 ms
22,752 KB
testcase_05 AC 56 ms
22,800 KB
testcase_06 AC 56 ms
20,716 KB
testcase_07 AC 56 ms
20,700 KB
testcase_08 AC 57 ms
20,772 KB
testcase_09 AC 57 ms
20,648 KB
testcase_10 AC 57 ms
22,696 KB
testcase_11 AC 56 ms
18,756 KB
testcase_12 AC 57 ms
20,732 KB
testcase_13 AC 56 ms
20,784 KB
testcase_14 AC 57 ms
22,752 KB
testcase_15 AC 58 ms
20,776 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        string line = System.Console.ReadLine().Trim();

        int M = int.Parse(line);

        long r_x = (2017 * 2017) % M;
        
        for (int i = 0; i < 2016; i++)
        {
            r_x = (r_x * 2017*2017) % M;
        }

        r_x = (2017 + r_x) % M;

        System.Console.WriteLine(r_x);
   }
}
0