結果
問題 | No.2203 POWER!!!!! |
ユーザー |
|
提出日時 | 2023-11-03 05:32:05 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 694 bytes |
コンパイル時間 | 2,715 ms |
コンパイル使用メモリ | 251,396 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 18:32:54 |
合計ジャッジ時間 | 3,501 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 5 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;#define rep(i,m,n) for(int i=m; i<n; ++i)#define repl(i,m,n) for(ll i=m; i<n; ++i)int main(){vector powered(10, vector(10, 1LL));rep(i, 1, 9){rep(j, 1, 9){rep(k, 0, j){powered[i][j] *= ll(i);}}}int N;cin >> N;vector<ll> A(N);for(ll &a : A) cin >> a;vector cnt(10, 0);rep(i, 0, N){cnt[A[i]]++;}ll ans = 0LL;rep(i, 1, 9){rep(j, 1, 9){repl(k, 0, cnt[i]*cnt[j]){ans += powered[i][j];}}}cout << ans << endl;return 0;}