結果

問題 No.1623 三角形の制作
ユーザー ππ
提出日時 2021-07-23 22:14:23
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 197,844 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-25 22:18:25
合計ジャッジ時間 5,181 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,380 KB
testcase_01 AC 7 ms
4,376 KB
testcase_02 AC 80 ms
4,380 KB
testcase_03 AC 76 ms
4,380 KB
testcase_04 AC 75 ms
4,376 KB
testcase_05 AC 132 ms
4,376 KB
testcase_06 AC 25 ms
4,376 KB
testcase_07 AC 76 ms
4,376 KB
testcase_08 AC 28 ms
4,380 KB
testcase_09 AC 71 ms
4,376 KB
testcase_10 AC 110 ms
4,380 KB
testcase_11 AC 87 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 7 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int t[3][3010] = {};
int main() {
  int n;
  cin >> n;
  for(int i = 0; i < 3; ++i) {
    for(int j = 0; j < n; ++j) {
      int a;
      cin >> a;
      ++t[i][a];
    }
  }
  for(int i = 1; i <= 3000; ++i) {
    t[2][i] += t[2][i-1];
  }
  long long count = 0;
  for(int r = 1; r <= 3000; ++r) {
    for(int g = 1; g <= r; ++g) {
      count += t[0][r]*t[1][g]*(t[2][r]-t[2][r-g]);
    }
  }
  cout << count << '\n';
}
0