結果

問題 No.1409 Simple Math in yukicoder
ユーザー 👑 ygussanyygussany
提出日時 2021-02-26 22:11:51
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 492 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 30,336 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-10 13:00:56
合計ジャッジ時間 58,016 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,624 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 520 ms
5,376 KB
testcase_08 AC 1,775 ms
5,376 KB
testcase_09 AC 454 ms
5,376 KB
testcase_10 AC 1,394 ms
5,376 KB
testcase_11 AC 1,769 ms
5,376 KB
testcase_12 AC 1,355 ms
5,376 KB
testcase_13 AC 511 ms
5,376 KB
testcase_14 AC 395 ms
5,376 KB
testcase_15 AC 615 ms
5,376 KB
testcase_16 AC 659 ms
5,376 KB
testcase_17 TLE -
testcase_18 AC 1,158 ms
5,376 KB
testcase_19 AC 1,224 ms
5,376 KB
testcase_20 AC 982 ms
5,376 KB
testcase_21 AC 792 ms
5,376 KB
testcase_22 AC 1,469 ms
5,376 KB
testcase_23 AC 309 ms
5,376 KB
testcase_24 AC 240 ms
5,376 KB
testcase_25 AC 1,432 ms
5,376 KB
testcase_26 AC 1,576 ms
5,376 KB
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int Mod;

long long pow_mod(int n, int k)
{
	long long N, ans = 1;
	for (N = n; k > 0; k >>= 1, N = N * N % Mod) if (k & 1) ans = ans * N % Mod;
	return ans;
}

int main()
{
	int i, j, t, T, v, x;
	scanf("%d", &T);
	for (t = 1; t <= T; t++) {
		scanf("%d %d", &v, &x);
		Mod = v * x + 1;
		
		for (i = 1, j = 0; i < Mod; i++) {
			if (pow_mod(i, x) == 1) {
				if (j > 0) printf(" ");
				printf("%d", i);
				j++;
			}
		}
		printf("\n");
	}
	fflush(stdout);
	return 0;
}
0