結果
| 問題 |
No.8034 7 problems
|
| コンテスト | |
| ユーザー |
夕叢霧香(ゆうむらきりか)
|
| 提出日時 | 2018-04-01 22:54:16 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 779 bytes |
| コンパイル時間 | 823 ms |
| コンパイル使用メモリ | 74,468 KB |
| 最終ジャッジ日時 | 2025-01-05 09:45:15 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 1 TLE * 50 |
ソースコード
#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)
const lint mod=1e9+7;
lint powmod(lint x,lint e){
lint prod=1;
for(int i=63;i>=0;--i){
prod=prod*prod%mod;
if(e&1LL<<i)prod=prod*x%mod;
}
return prod;
}
int main(){
int t;
cin>>t;
rep(i,t){
lint 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<<powmod(n,n*n*n%(mod-1))<<endl;
cout<<n<<endl;
lint tmp=0;
rep(i,n+1){
if(i<=1)continue;
tmp=(tmp+powmod(i,mod-2))%mod;
}
tmp=tmp*n%mod;
rep(i,n)tmp=tmp*(i+1)%mod;
cout<<tmp<<endl;
cout<<endl;
}
}
夕叢霧香(ゆうむらきりか)