結果
| 問題 |
No.1578 A × B × C
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-20 00:10:11 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 2,000 ms |
| コード長 | 2,954 bytes |
| コンパイル時間 | 7,397 ms |
| コンパイル使用メモリ | 166,836 KB |
| 実行使用メモリ | 185,524 KB |
| 最終ジャッジ日時 | 2024-07-17 13:38:08 |
| 合計ジャッジ時間 | 9,835 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (93 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) /home/judge/data/code/Main.cs(29,11): warning CS8981: 型名 'input' には、小文字の ASCII 文字のみが含まれています。このような名前は、プログラミング言語用に予約されている可能性があります。 [/home/judge/data/code/main.csproj] /home/judge/data/code/Main.cs(95,11): warning CS8981: 型名 'mod' には、小文字の ASCII 文字のみが含まれています。このような名前は、プログラミング言語用に予約されている可能性があります。 [/home/judge/data/code/main.csproj] main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
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;
}
}
}