結果
問題 |
No.8085 Math...?
|
ユーザー |
👑 ![]() |
提出日時 | 2021-04-01 20:29:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 604 bytes |
コンパイル時間 | 2,856 ms |
コンパイル使用メモリ | 194,940 KB |
最終ジャッジ日時 | 2025-01-20 05:42:36 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 WA * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:14:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d",&Q); | ~~~~~^~~~~~~~~ main.cpp:15:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | A.resize(Q+1); rep(i,Q) scanf("%d",&A[i+1]); | ~~~~~^~~~~~~~~~~~~~ main.cpp:16:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | B.resize(Q+1); rep(i,Q) scanf("%d",&B[i+1]); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <atcoder/modint> #include <bits/stdc++.h> using namespace std; using ll=long long; using ull=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) using mll = atcoder::static_modint<1000000007>; int Q; vector<int> A,B; int main(){ scanf("%d",&Q); A.resize(Q+1); rep(i,Q) scanf("%d",&A[i+1]); B.resize(Q+1); rep(i,Q) scanf("%d",&B[i+1]); for(int i=1; i<=Q; i++){ mll ans=1; for(int i2=1; i2<=A[i]; i2++){ mll sum=0; for(int j=1; j<=B[i2]; j++){ sum += mll(j).pow(i2); } ans *= sum; } printf("%u\n",ans.val()); } return 0; }