結果
| 問題 | No.2203 POWER!!!!! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-09 03:38:06 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 562 bytes |
| 記録 | |
| コンパイル時間 | 1,284 ms |
| コンパイル使用メモリ | 209,708 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-29 12:40:02 |
| 合計ジャッジ時間 | 2,275 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
int po(int x,int y)
{
if(y==0) return 1;
if(y==1) return x;
if(y%2==0) {int u=po(x,y/2);return (u*u);}
else {int u=po(x,y-1);return (x*u);}
}
int32_t main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int n;cin>>n;
int cnt[9]={0};for(int i=0;i<n;++i) {int x;cin>>x;cnt[x]++;}
int res=0;
for(int i=1;i<=8;++i)
{
for(int j=1;j<=8;++j)
{
res+=cnt[i]*cnt[j]*po(i,j);
}
}
cout<<res;
return 0;
}