結果

問題 No.3034 7 problems
ユーザー mtsdmtsd
提出日時 2018-04-02 16:09:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,230 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 73,648 KB
実行使用メモリ 5,240 KB
最終ジャッジ日時 2023-09-08 13:26:44
合計ジャッジ時間 11,045 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
4,968 KB
testcase_01 AC 83 ms
4,880 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

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)%mod << endl;
        cout << (n*n*n+n*n-n)%mod << endl;
        cout << t << endl;
        cout << (4*n*n+17)%mod << 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