結果
| 問題 |
No.976 2 の 128 乗と M
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-29 23:15:56 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 218 bytes |
| コンパイル時間 | 418 ms |
| コンパイル使用メモリ | 27,776 KB |
| 最終ジャッジ日時 | 2025-01-08 20:44:00 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 50 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | i64 M; scanf("%ld", &M);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <cstdint>
#include <cstdio>
using i64 = int64_t;
int main(void) {
i64 M; scanf("%ld", &M);
i64 res = 1;
for(int i=0; i<128; ++i) {
res <<= 1;
res %= M;
}
printf("%ld\n", res);
return 0;
}