結果
| 問題 |
No.483 マッチ並べ
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2017-02-10 22:50:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 643 bytes |
| コンパイル時間 | 998 ms |
| コンパイル使用メモリ | 71,588 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-29 08:11:22 |
| 合計ジャッジ時間 | 2,872 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 29 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
using namespace std;
int main()
{
int n; cin >> n;
vector<pair<int, int>>X;
X.reserve(2 * n);
for (int i = 0; i < n; i++) {
int r0, r1, c0, c1;
cin >> r0 >> c0 >> r1 >> c1;
X.push_back(make_pair(r0, c0));
X.push_back(make_pair(r1, c1));
}
sort(X.begin(), X.end());
int cnt = 0;
bool flag = true;
for (int i = 1; i < 2 * n; i++) {
if (X[i] == X[i - 1]) {
cnt++;
}
else {
if (cnt >= 2)flag = false;
cnt = 0;
}
}
if (cnt > 2)flag = false;
if (flag)cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
kurenai3110