結果

問題 No.1578 A × B × C
ユーザー TAKA 00TAKA 00
提出日時 2021-07-20 00:10:11
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 2,954 bytes
コンパイル時間 6,573 ms
コンパイル使用メモリ 145,788 KB
実行使用メモリ 162,248 KB
最終ジャッジ日時 2023-09-24 12:43:33
合計ジャッジ時間 8,897 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
28,228 KB
testcase_01 AC 46 ms
30,148 KB
testcase_02 AC 45 ms
28,148 KB
testcase_03 AC 44 ms
28,536 KB
testcase_04 AC 45 ms
30,224 KB
testcase_05 AC 45 ms
28,040 KB
testcase_06 AC 45 ms
28,152 KB
testcase_07 AC 45 ms
28,144 KB
testcase_08 AC 45 ms
28,328 KB
testcase_09 AC 46 ms
28,044 KB
testcase_10 AC 46 ms
28,104 KB
testcase_11 AC 45 ms
30,124 KB
testcase_12 AC 46 ms
28,348 KB
testcase_13 AC 46 ms
28,392 KB
testcase_14 AC 46 ms
28,524 KB
testcase_15 AC 47 ms
28,284 KB
testcase_16 AC 45 ms
28,220 KB
testcase_17 AC 46 ms
28,192 KB
testcase_18 AC 46 ms
28,384 KB
testcase_19 AC 45 ms
28,196 KB
testcase_20 AC 45 ms
28,088 KB
testcase_21 AC 46 ms
28,304 KB
testcase_22 AC 46 ms
28,416 KB
testcase_23 AC 45 ms
28,116 KB
testcase_24 AC 45 ms
162,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 115 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

using System;
using System.Linq;
using System.Numerics;

namespace ABC209_C3
{
    class Program
    {
        static void Main(string[] args)
        {
            cin = new input();
            mod = new mod();
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            long A = cin.longreed();
            long B = cin.longreed();
            long C = cin.longreed();
            long K = cin.longreed();
            long ans = mod.multiplication(A, B);
            ans = mod.multiplication(ans, C);
            K = (long)BigInteger.ModPow(2, K, 1000000006);
            Console.WriteLine((long)BigInteger.ModPow(ans,K, 1000000007));

            Console.Out.Flush();
        }
        static input cin;
        static mod mod;
    }
    class input
    {
        string[] soloinput;
        int t;
        public input()
        {
            soloinput = new string[0];
            t = 0;
        }
        public string soloreed()
        {
            if (t < soloinput.Length)
            {
                return soloinput[t++];
            }
            string input = Console.ReadLine();
            while (input == "")
            {
                input = Console.ReadLine();
            }
            soloinput = input.Split(" ");
            t = 0;
            return soloinput[t++];
        }
        public int intreed()
        {
            return int.Parse(soloreed());
        }
        public int[] arrayint(int N)
        {
            int[] A = new int[N];
            for (int i = 0; i < N; i++)
            {
                A[i] = intreed();
            }
            return A;
        }
        public long longreed()
        {
            return long.Parse(soloreed());
        }
        public long[] arraylong(long N)
        {
            long[] A = new long[N];
            for (long i = 0; i < N; i++)
            {
                A[i] = longreed();
            }
            return A;
        }
        public decimal decimalreed()
        {
            return decimal.Parse(soloreed());
        }
        public decimal[] arraydecimal(long N)
        {
            decimal[] A = new decimal[N];
            for (decimal i = 0; i < N; i++)
            {
                A[(long)i] = decimalreed();
            }
            return A;
        }


    }
    class mod
    {
        long T;
        public mod(long mod = 1000000007)
        {
            T = mod;
        }
        public long addition(long A, long B)
        {
            decimal C = A + B;
            return (long)C % T;
        }
        public long subtraction(long A, long B)
        {
            decimal C = A - B;
            //return (long)Math.Abs(C % A);
            return C % T >= 0 ? (long)C % T : (long)(C + T) % T;
        }
        public long multiplication(long A, long B)
        {
            return ((A % T) * (B % T)) % T;
        }

    }
}


0