結果
| 問題 |
No.2203 POWER!!!!!
|
| コンテスト | |
| ユーザー |
ぷら
|
| 提出日時 | 2023-02-03 21:28:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 620 bytes |
| コンパイル時間 | 1,694 ms |
| コンパイル使用メモリ | 195,532 KB |
| 最終ジャッジ日時 | 2025-02-10 08:43:09 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
long long intpow(long long a,long long b) {
long long ans = 1;
while(b) {
if(b & 1) {
(ans *= a);
}
(a *= a);
b /= 2;
}
return ans;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<int>A(N),B(9);
for(int i = 0; i < N; i++) {
cin >> A[i];
B[A[i]]++;
}
long long ans = 0;
for(int i = 1; i <= 8; i++) {
for(int j = 1; j <= 8; j++) {
ans += B[i]*B[j]*intpow(i,j);
}
}
cout << ans << endl;
}
ぷら