結果
| 問題 |
No.1623 三角形の制作
|
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2023-06-11 05:46:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 807 bytes |
| コンパイル時間 | 1,225 ms |
| コンパイル使用メモリ | 107,524 KB |
| 最終ジャッジ日時 | 2025-02-14 01:33:50 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>
using namespace std;
using ll = long long;
int main(){
ll N, g, b, ans=0, cnt;
cin >> N;
vector<ll> r(N), cb(3e3+1), cg(3e3+1);
for (int i=0; i<N; i++) cin >> r[i];
for (int i=0; i<N; i++){
cin >> g;
cg[g]++;
}
for (int i=0; i<N; i++){
cin >> b;
cb[b]++;
}
for (int g=1; g<=3e3; g++){
for (int b=1; b<=3e3; b++){
cnt = lower_bound(r.begin(), r.end(), g+b)-lower_bound(r.begin(), r.end(), max(g, b));
ans += cnt * cg[g] * cb[b];
}
}
cout << ans << endl;
return 0;
}
srjywrdnprkt