結果

問題 No.3034 7 problems
ユーザー FF256grhyFF256grhy
提出日時 2018-04-02 19:09:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 1,106 bytes
コンパイル時間 1,389 ms
コンパイル使用メモリ 165,428 KB
実行使用メモリ 4,396 KB
最終ジャッジ日時 2023-09-08 13:31:28
合計ジャッジ時間 5,481 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,380 KB
testcase_01 AC 4 ms
4,380 KB
testcase_02 AC 36 ms
4,380 KB
testcase_03 AC 14 ms
4,376 KB
testcase_04 AC 15 ms
4,380 KB
testcase_05 AC 31 ms
4,380 KB
testcase_06 AC 27 ms
4,384 KB
testcase_07 AC 27 ms
4,376 KB
testcase_08 AC 23 ms
4,376 KB
testcase_09 AC 31 ms
4,380 KB
testcase_10 AC 16 ms
4,376 KB
testcase_11 AC 26 ms
4,380 KB
testcase_12 AC 19 ms
4,380 KB
testcase_13 AC 23 ms
4,376 KB
testcase_14 AC 22 ms
4,376 KB
testcase_15 AC 21 ms
4,376 KB
testcase_16 AC 21 ms
4,376 KB
testcase_17 AC 23 ms
4,380 KB
testcase_18 AC 44 ms
4,380 KB
testcase_19 AC 25 ms
4,380 KB
testcase_20 AC 27 ms
4,380 KB
testcase_21 AC 12 ms
4,380 KB
testcase_22 AC 35 ms
4,376 KB
testcase_23 AC 22 ms
4,380 KB
testcase_24 AC 37 ms
4,376 KB
testcase_25 AC 33 ms
4,376 KB
testcase_26 AC 13 ms
4,380 KB
testcase_27 AC 43 ms
4,376 KB
testcase_28 AC 32 ms
4,380 KB
testcase_29 AC 30 ms
4,376 KB
testcase_30 AC 11 ms
4,380 KB
testcase_31 AC 33 ms
4,380 KB
testcase_32 AC 20 ms
4,376 KB
testcase_33 AC 31 ms
4,376 KB
testcase_34 AC 14 ms
4,380 KB
testcase_35 AC 31 ms
4,376 KB
testcase_36 AC 22 ms
4,376 KB
testcase_37 AC 9 ms
4,380 KB
testcase_38 AC 29 ms
4,380 KB
testcase_39 AC 30 ms
4,376 KB
testcase_40 AC 38 ms
4,384 KB
testcase_41 AC 19 ms
4,384 KB
testcase_42 AC 31 ms
4,376 KB
testcase_43 AC 43 ms
4,388 KB
testcase_44 AC 14 ms
4,380 KB
testcase_45 AC 22 ms
4,380 KB
testcase_46 AC 18 ms
4,376 KB
testcase_47 AC 15 ms
4,396 KB
testcase_48 AC 16 ms
4,376 KB
testcase_49 AC 39 ms
4,376 KB
testcase_50 AC 16 ms
4,376 KB
testcase_51 AC 16 ms
4,380 KB
testcase_52 AC 5 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

// ---- ----

LL t, MOD = 1e9 + 7, dp[100001];
LL ex(LL x, LL y, LL mod = MOD) {
	LL z[64], v = 1;
	inc(i, 64) { z[i] = (i == 0 ? x : z[i - 1] * z[i - 1] % mod); }
	inc(i, 64) { if((y >> i) & 1) { (v *= z[i]) %= mod; } }
	return v;
}

int main() {
	LL f = 1;
	inc1(i, 100000) {
		dp[i] = (i == 1 ? 0 : (dp[i - 1] * i + f) % MOD);
		(f *= i) %= MOD;
	}
	
	cin >> t;
	inc(q, t) {
		if(q != 0) { cout << "\n"; }
		LL n;
		cin >> n;
		LL ans[7] = {
			n * n,
			n * n * n - n + n * n,
			t,
			4 * n * n + 17,
			ex(n, n * n * n),
			n,
			dp[n] * n % MOD
		};
		inc(i, 7) { cout << ans[i] << "\n"; }
	}
	
	return 0;
}
0