結果
問題 |
No.251 大きな桁の復習問題(1)
|
ユーザー |
![]() |
提出日時 | 2015-10-17 20:33:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 824 bytes |
コンパイル時間 | 600 ms |
コンパイル使用メモリ | 70,932 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-22 10:53:33 |
合計ジャッジ時間 | 5,852 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 15 WA * 6 |
ソースコード
#include<iostream> #include<vector> #include<set> #include<map> #include<list> #include<stack> #include<queue> #include<bitset> #include<array> #include<algorithm> #include<cstdio> #include<string> #include<cstdlib> #include<numeric> #define D long long #define U unsigned using namespace std; D n, m, a, b, d, e; char c; bool g, h; string s; D ans; int main() { D i, j, k; string x, y; D ten,t; cin >> x >> y; reverse(x.begin(), x.end()); reverse(y.begin(), y.end()); ten = 1; for (auto z : x) { z -= '0'; a += z*ten; a %= 129402307; ten *= 10; ten %= 129402307; } ten = 1; for (auto z : y) { z -= '0'; b += z*ten; b %= 129402306; ten *= 10; ten %= 129402306; } t = 1; for (i = 1; i <= b; i++) { t *= a; t %= 129402307; if (t == 1) { b %= i; i = 1; } } cout << t << endl; }