結果

問題 No.2203 POWER!!!!!
ユーザー irohasu19_irohasu19_
提出日時 2023-02-11 01:09:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,254 bytes
コンパイル時間 2,732 ms
コンパイル使用メモリ 201,204 KB
実行使用メモリ 4,876 KB
最終ジャッジ日時 2023-09-22 01:34:51
合計ジャッジ時間 3,419 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 11 ms
4,380 KB
testcase_10 AC 17 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 5 ms
4,376 KB
testcase_13 AC 30 ms
4,660 KB
testcase_14 AC 30 ms
4,660 KB
testcase_15 AC 30 ms
4,580 KB
testcase_16 AC 31 ms
4,592 KB
testcase_17 AC 31 ms
4,876 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h> 
#define repr(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,n) for(int i=0;i<n;i++) 
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b) 
#define reprev(i,n) reprrev(i,0,n) 
#define _GLIBCXX_DEBUG 
#define int long long                     
using ll = long long; 
using ull = unsigned long long; 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } 
const ll mod = 1e9+7; 
void chmod(ll &M){ 
  if(M >= mod) M %= mod; 
  else if(M < 0){ 
     M += (abs(M)/mod + 1)*mod; 
    M %= mod; 
} 
} 
int getl(int i, int N) { return i==0? N-1:i-1; }; 
int getr(int i, int N) { return i==N-1? 0:i+1; }; 
long long GCD(long long a, long long b) { 
  if (b == 0) return a; 
  else return GCD(b, a % b); 
} 
using namespace std; 
using Graph = vector<vector<int>>;

signed main() {
  int n; cin >> n;
  vector<int> A(n);
  rep(i, n) {
    cin >> A[i];
  }
  vector<int> count(9, 0);
  rep(i, n) {
    count[A[i]]++;
  }

  ll ans = 0;
  for(int i = 1; i <= 8; i++) {
    for(int j = 1; j <= 8; j++) {
      ans += count[i] * count[j] * pow(i, j);
    }
  }

  cout << ans << endl;
  }
  
  
0