結果
問題 |
No.408 五輪ピック
|
ユーザー |
|
提出日時 | 2025-04-23 22:40:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,355 bytes |
コンパイル時間 | 1,069 ms |
コンパイル使用メモリ | 96,040 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-04-23 22:40:37 |
合計ジャッジ時間 | 6,776 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 32 |
ソースコード
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define ll long long #define mst(x, y) memset(x, y, sizeof(x)) #define ciallo putchar('\n') #define ilv inline void #define ili inline int #define ilb inline bool #define ill inline long long constexpr auto N = 1000010; constexpr auto INF = 0x3f3f3f3f; constexpr auto eps = 1e-4; constexpr ll mod = 1e12 + 7; using namespace std; int n, m; vector<vector<int>> map, t; int main() { // freopen("circle.in", "r", stdin); // freopen("circle.out", "w", stdout); cin >> n >> m; map.resize(n + 1); for (int i = 1; i <= m; ++i) { int u, v; cin >> u >> v; map[u].push_back(v); map[v].push_back(u); } for (auto u : map[1]) { for (auto v : map[u]) { if (v == 1) continue; if (t[v].size() < 3) t[v].push_back(u); } } for (int i = 2; i <= n; ++i) for (auto v : map[i]) for (int j = 0; j < t[v].size(); ++j) for (int k = 0; k < t[v].size(); ++k) if (t[i][j] != v && t[i][j] != t[v][k] && t[v][k] != i) cout << "YES" << '\n', exit(0); cout << "NO" << '\n'; // fclose(stdin); // fclose(stdout); return 0; }