結果

問題 No.251 大きな桁の復習問題(1)
ユーザー 唐澤貴洋唐澤貴洋
提出日時 2015-10-17 20:33:43
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 824 bytes
コンパイル時間 858 ms
コンパイル使用メモリ 71,548 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-29 16:49:15
合計ジャッジ時間 7,093 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 334 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 557 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 43 ms
4,376 KB
testcase_12 AC 219 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 55 ms
4,380 KB
testcase_15 AC 270 ms
4,380 KB
testcase_16 AC 167 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 384 ms
4,376 KB
testcase_20 AC 536 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0