結果
| 問題 |
No.251 大きな桁の復習問題(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-10-04 20:26:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 345 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 24,576 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-19 19:35:29 |
| 合計ジャッジ時間 | 986 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 7 WA * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:15:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%llu", &n); fflush(stdin);
| ~~~~~^~~~~~~~~~~~
main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%llu", &m); fflush(stdin);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
typedef unsigned long long ul;
ul modPow(ul x, ul y) {
if(y == 0) return 1;
ul res = modPow(x * x % 129402307, y >> 1);
if(y & 1) res = res * x % 129402307;
return res;
}
int main() {
ul n, m;
scanf("%llu", &n); fflush(stdin);
scanf("%llu", &m); fflush(stdin);
printf("%llu\n", modPow(n, m));
}