結果

問題 No.2203 POWER!!!!!
ユーザー irohasu19_
提出日時 2023-02-04 07:20:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 866 bytes
コンパイル時間 1,704 ms
コンパイル使用メモリ 193,612 KB
最終ジャッジ日時 2025-02-10 10:34:40
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}

int main() {
  int N; cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<int> count(9, 0);
  for(int i = 0; i < N; i++) {
    count[A[i]]++;
  }
long long 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