結果
| 問題 |
No.976 2 の 128 乗と M
|
| ユーザー |
りあん
|
| 提出日時 | 2020-01-31 13:49:34 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 1,168 bytes |
| コンパイル時間 | 929 ms |
| コンパイル使用メモリ | 114,552 KB |
| 実行使用メモリ | 17,792 KB |
| 最終ジャッジ日時 | 2024-09-17 06:50:05 |
| 合計ジャッジ時間 | 3,849 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 50 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;
using static util;
class Program {
static void Main(string[] args) {
var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
var solver = new Solver(sw);
// var t = new Thread(solver.solve, 1 << 26); // 64 MB
// t.Start();
// t.Join();
solver.solve();
sw.Flush();
}
}
class Solver {
StreamWriter sw;
// Scan sc;
void Prt(string a) => sw.WriteLine(a);
void Prt<T>(IEnumerable<T> a) => Prt(string.Join(" ", a));
void Prt(params object[] a) => Prt(string.Join(" ", a));
public Solver(StreamWriter sw) {
this.sw = sw;
// this.sc = new Scan();
}
public void solve() {
long m = long.Parse(Console.ReadLine());
Assert(1 <= m && m < 1L << 60);
long ans = 1;
for (int i = 0; i < 128; i++)
ans = ans * 2 % m;
Prt(ans);
}
}
static class util {
public static void Assert(params bool[] conds) {
foreach (var cond in conds) if (!cond) throw new Exception();
}
}
りあん