結果

問題 No.3034 7 problems
ユーザー mtsdmtsd
提出日時 2018-04-02 16:23:59
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 1,212 bytes
コンパイル時間 1,504 ms
コンパイル使用メモリ 73,552 KB
実行使用メモリ 5,208 KB
最終ジャッジ日時 2023-09-08 13:29:09
合計ジャッジ時間 12,768 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
4,944 KB
testcase_01 AC 83 ms
4,924 KB
testcase_02 AC 180 ms
4,888 KB
testcase_03 AC 112 ms
4,888 KB
testcase_04 AC 114 ms
4,968 KB
testcase_05 AC 164 ms
4,928 KB
testcase_06 AC 152 ms
4,944 KB
testcase_07 AC 155 ms
5,200 KB
testcase_08 AC 141 ms
4,908 KB
testcase_09 AC 163 ms
5,088 KB
testcase_10 AC 118 ms
4,884 KB
testcase_11 AC 144 ms
4,960 KB
testcase_12 AC 123 ms
4,884 KB
testcase_13 AC 136 ms
4,964 KB
testcase_14 AC 132 ms
4,952 KB
testcase_15 AC 132 ms
4,908 KB
testcase_16 AC 130 ms
4,888 KB
testcase_17 AC 136 ms
4,964 KB
testcase_18 AC 196 ms
4,916 KB
testcase_19 AC 143 ms
4,992 KB
testcase_20 AC 150 ms
5,208 KB
testcase_21 AC 106 ms
4,940 KB
testcase_22 AC 173 ms
4,960 KB
testcase_23 AC 135 ms
4,912 KB
testcase_24 AC 174 ms
4,880 KB
testcase_25 AC 170 ms
4,912 KB
testcase_26 AC 108 ms
5,200 KB
testcase_27 AC 197 ms
5,008 KB
testcase_28 AC 163 ms
4,884 KB
testcase_29 AC 156 ms
4,868 KB
testcase_30 AC 103 ms
4,968 KB
testcase_31 AC 164 ms
4,876 KB
testcase_32 AC 128 ms
4,868 KB
testcase_33 AC 161 ms
4,916 KB
testcase_34 AC 108 ms
4,932 KB
testcase_35 AC 163 ms
4,880 KB
testcase_36 AC 136 ms
4,952 KB
testcase_37 AC 95 ms
4,960 KB
testcase_38 AC 154 ms
4,944 KB
testcase_39 AC 158 ms
5,172 KB
testcase_40 AC 178 ms
4,928 KB
testcase_41 AC 124 ms
5,076 KB
testcase_42 AC 160 ms
4,928 KB
testcase_43 AC 194 ms
5,060 KB
testcase_44 AC 114 ms
4,880 KB
testcase_45 AC 134 ms
4,928 KB
testcase_46 AC 120 ms
4,888 KB
testcase_47 AC 114 ms
4,884 KB
testcase_48 AC 117 ms
5,152 KB
testcase_49 AC 181 ms
4,880 KB
testcase_50 AC 117 ms
4,992 KB
testcase_51 AC 118 ms
5,020 KB
testcase_52 AC 83 ms
4,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back

ll mod = 1000000007;

long long calc(long long  k,long long m,long long p){
	if(m==0)return 1;
	if(m==1)return k%p;
	long long s = calc(k,m/2,p);
	if(m%2==0){
		return (s*s)%p;
	}else{
		long long ans;
		ans = (s*s)%p;
		return (k*ans)%p;
	}
}


ll dp[100010];
ll kai[100010];
int main(){
    
    int t;
    cin >> t;
    dp[0] = 0;
    for(ll i=1;i<=100000;i++){
        dp[i] = (dp[i-1]+1 + dp[i-1]*calc(i,mod-2,mod))%mod;
    }
    kai[0] = 1;
    for(ll i=1;i<=100000;i++){
        kai[i] = (i*kai[i-1])%mod;
    }
    for(int i=0;i<t;i++){
        ll n;
        cin >> n;
        cout << n*n << endl;
        cout << n*n*n+n*n-n << endl;
        cout << t << endl;
        cout << 4*n*n+17 << endl;
        cout << calc(n,calc(n,3,mod-1),mod) << endl;
        cout << n << endl;
        cout << (dp[n-1]*kai[n])%mod << endl;
        if(i!=(t-1))cout << endl;
    }

    return 0;
}
0