結果
問題 | No.2394 部分和乗総和 |
ユーザー | YocyCraft |
提出日時 | 2023-07-28 21:29:13 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,088 bytes |
コンパイル時間 | 1,705 ms |
コンパイル使用メモリ | 169,212 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 17:39:48 |
合計ジャッジ時間 | 2,772 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 2 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 2 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 64 ms
5,248 KB |
コンパイルメッセージ
main.cpp: In function 'std::ostream& operator<<(std::ostream&, const std::tuple<T1, T2, T3>&)': main.cpp:66:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions] 66 | auto &[t1, t2, t3] = tp; | ^ main.cpp: In function 'std::ostream& operator<<(std::ostream&, const std::map<K, V>&)': main.cpp:95:20: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions] 95 | for (auto &[k, v] : m) { | ^ main.cpp: In function 'std::ostream& operator<<(std::ostream&, const std::unordered_map<K, V>&)': main.cpp:105:20: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions] 105 | for (auto &[k, v] : m) { | ^
ソースコード
#include <bits/stdc++.h> using namespace std; char nl = '\n'; char sp = ' '; using ll = long long; using vb = vector<bool>; using vi = vector<int>; using vl = vector<ll>; using vvb = vector<vb>; using vvi = vector<vi>; using vvl = vector<vl>; using si = unordered_set<int>; using sl = unordered_set<ll>; using tsi = set<int>; using tsl = set<ll>; using pii = pair<int, int>; using pll = pair<ll, ll>; using vpii = vector<pii>; using vpll = vector<pll>; using tmii = map<int, int>; using tmll = map<ll, ll>; using mii = unordered_map<int, int>; using mll = unordered_map<ll, ll>; using pqi = priority_queue<int>; using pqig = priority_queue<int, vi, greater<int>>; using pql = priority_queue<ll>; using pqlg = priority_queue<ll, vl, greater<ll>>; using pqpii = priority_queue<pii>; using pqpll = priority_queue<pll>; #define tp3(T) tuple<T,T,T> #define tp4(T) tuple<T,T,T,T> #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define sort_and_unique(a) sort(all(a));(a).resize(unique(all(a))-(a).begin()) #define outrange(x,min,max) ((x)<(min) || (x)>(max)) ll _start_time; #define nano (chrono::system_clock::now().time_since_epoch().count()) #define reset_timer _start_time=nano #define chime cout<<((nano-_start_time)/1e9)<<endl #define init_rng mt19937 rng(nano) #define randint(a,b) ((a)+rng()%((b)-(a)+1)) #ifndef ONLINE_JUDGE #define debug(x) (cout<<(#x)<<':'<<(x)<<'\n') #else #define debug(x) #endif void yesno(bool a) { cout << (a ? "Yes\n" : "No\n"); } template<typename L, typename R> ostream& operator<<(ostream& out, const pair<L, R>& p) { out << '(' << p.first << ',' << p.second << ')'; return out; } template<typename T1, typename T2, typename T3> ostream& operator<<(ostream& out, const tuple<T1, T2, T3>& tp) { auto &[t1, t2, t3] = tp; out << '(' << t1 << ',' << t2 << ',' << t3 << ')'; return out; } template<typename T> ostream& operator<<(ostream& out, const vector<T>& v) { for (auto &i : v) out << i << ' '; out << nl; return out; } template<typename T> ostream& operator<<(ostream& out, const set<T>& v) { for (auto &i : v) out << i << ' '; out << nl; return out; } template<typename T> ostream& operator<<(ostream& out, const unordered_set<T>& v) { for (auto &i : v) out << i << ' '; out << nl; return out; } template<typename K, typename V> ostream& operator<<(ostream& out, const map<K, V>& m) { out << '['; for (auto &[k, v] : m) { out << k << ':' << v << sp; } out << "]\n"; return out; } template<typename K, typename V> ostream& operator<<(ostream& out, const unordered_map<K, V>& m) { out << '['; for (auto &[k, v] : m) { out << k << ':' << v << sp; } out << "]\n"; return out; } ll mod; ll modPow(ll n,ll pow) { if(pow==1) return n; ll result=1; while(pow>0) { if((pow&1)==1) result=(result*n)%mod; pow>>=1; if(pow==0) break; n=(n*n)%mod; } return result; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n,m; cin>>n>>m>>mod; m%=mod; ll ans=1%mod; for(int i=0;i<n;i++){ int a; cin>>a; ans=ans*(1+modPow(m,a))%mod; } cout<<ans<<nl; }