結果
問題 | No.1623 三角形の制作 |
ユーザー |
|
提出日時 | 2021-09-15 17:35:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 763 bytes |
コンパイル時間 | 734 ms |
コンパイル使用メモリ | 73,472 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-28 18:23:51 |
合計ジャッジ時間 | 4,463 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | TLE * 1 -- * 18 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(){int n,i,j,k;cin >> n;vector<int> r(n), g, b;int maxR = 0;for (i = 0; i < n; i++) {cin >> r[i];if (maxR < r[i]) {maxR = r[i];}}int v;for (i = 0; i < n; i++) {cin >> v;if (v <= maxR) {g.push_back(v);}}for (i = 0; i < n; i++) {cin >> v;if (v <= maxR) {b.push_back(v);}}int ans = 0;for (i = 0; i < n; i++) {for (j = 0; j < g.size(); j++) {for (k = 0; k < b.size(); k++) {int x = g[j] - b[k];if (x < 0) {x = -x;}int y = g[j] + b[k];if (r[i] > x && r[i] < y) {if (r[i] >= g[j] && r[i] >= b[k]) {ans++;}}}}}cout << ans << endl;return 0;}