結果

問題 No.487 2017 Calculation(2017の計算)
ユーザー 14番14番
提出日時 2017-03-02 15:20:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 1,304 bytes
コンパイル時間 4,688 ms
コンパイル使用メモリ 102,808 KB
実行使用メモリ 22,696 KB
最終ジャッジ日時 2023-09-03 20:36:12
合計ジャッジ時間 3,967 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
22,628 KB
testcase_01 AC 52 ms
20,708 KB
testcase_02 AC 53 ms
20,712 KB
testcase_03 AC 53 ms
22,612 KB
testcase_04 AC 52 ms
20,708 KB
testcase_05 AC 54 ms
22,696 KB
testcase_06 AC 53 ms
20,564 KB
testcase_07 AC 52 ms
20,756 KB
testcase_08 AC 52 ms
20,652 KB
testcase_09 AC 53 ms
20,608 KB
testcase_10 AC 54 ms
20,656 KB
testcase_11 AC 52 ms
20,660 KB
testcase_12 AC 52 ms
22,608 KB
testcase_13 AC 52 ms
20,668 KB
testcase_14 AC 52 ms
20,724 KB
testcase_15 AC 52 ms
20,804 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.Linq;
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using System.Text;
     
    public class Program
    {
        public void Proc() {
            Reader.IsDebug = false;
            int div = int.Parse(Reader.ReadLine());
            int mul = (int)((2017L*2017)%div);

            int tmp = 1;
            for(int i=1; i<=2017; i++) {
                tmp = tmp * mul;
                tmp = tmp % div;
            }
            tmp += 2017;
            tmp = tmp % div;
            Console.WriteLine(tmp);

        }

        public class Reader {
            public static bool IsDebug = true;
            private static System.IO.StringReader SReader;
            private static string InitText = @"


1


";
            public static string ReadLine() {
                if(IsDebug) {
                    if(SReader == null) {
                        SReader = new System.IO.StringReader(InitText.Trim());
                    }
                    return SReader.ReadLine();
                } else {
                    return Console.ReadLine();
                }
            }
        }
        public static void Main(string[] args)
        {
            Program prg = new Program();
            prg.Proc();
        }
    }
0