結果
問題 |
No.2203 POWER!!!!!
|
ユーザー |
|
提出日時 | 2023-02-12 03:00:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 1,732 ms |
コンパイル使用メモリ | 191,816 KB |
最終ジャッジ日時 | 2025-02-10 14:38:59 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; using pii=pair<int,int>; #define all(a) a.begin(),a.end() #define pb push_back #define sz(a) ((int)a.size()) int cnt[10]; signed main(){ ios_base::sync_with_stdio(0),cin.tie(0); int n; cin >> n; for(int i=0; i<n; ++i){int x; cin >> x; cnt[x]++;} ll res=0; for(int i=1; i<=8; ++i) for(int j=1; j<=8; ++j){ int de=1; for(int k=0; k<j; ++k) de*=i; res+=1ll*cnt[i]*cnt[j]*de; } cout << res << "\n"; }