# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
153084 | 2019-09-12T09:38:56 Z | Mercenary | Potemkin cycle (CEOI15_indcyc) | C++14 | 9 ms | 632 KB |
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/trie_policy.hpp> #define pb push_back #define mp make_pair #define taskname "A" using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef long double ld; typedef pair<int,int> ii; typedef tree <int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; const int maxn = 1e3 + 5; bitset<maxn> s[maxn] , l[maxn]; int n , m; int u[maxn] , v[maxn]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); if(fopen(taskname".INP","r")){ freopen(taskname".INP", "r",stdin); freopen(taskname".OUT", "w",stdout); } cin >> n >> m; for(int i = 0 ; i < m ; ++i){ int u , v;cin >> u >> v;--u;--v; // if(u == v)continue; ::u[i] = u;::v[i] = v; s[u].set(v , 1); s[v].set(u , 1); } for(int i = 0 ; i < n ; ++i)s[i][i] = 1; for(int i = 0 ; i < n ; ++i){ for(int j = 0 ; j < maxn ; ++j){ s[i][j] = !s[i][j]; } } for(int i = 0 ; i < m ; ++i){ l[u[i]] |= (s[v[i]]); l[v[i]] |= (s[u[i]]); } for(int i = 0 ; i < n ; ++i){ l[i] &= s[i]; } for(int i = 0 ; i < n ; ++i){ l[i].set(i , 0); for(int j = 0 ; j < maxn ; ++j){ s[i][j] = !s[i][j]; } } for(int i = 0 ; i < m ; ++i){ int u = ::u[i]; int v = ::v[i]; if(u == v)continue; if((l[u] & s[v]).count() >= 1 && (l[v] & s[u]).count() >= 1){ for(int i = 0 ; i < n ; ++i){ for(int j = 0 ; j < n ; ++j){ if(s[u][j] == 0 && s[i][j] == 0 && s[i][v] == 0){ return cout << i + 1 << " " << u + 1<< " " << v + 1 << " " << j + 1 , 0; } } } } } // cout << s[] cout << "no"; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Expected integer, but "no" found |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Wrong adjacency |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Wrong adjacency |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Wrong adjacency |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 348 KB | Wrong adjacency |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 476 KB | Wrong answer on graph without induced cycle |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 376 KB | Expected integer, but "no" found |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 9 ms | 632 KB | Expected integer, but "no" found |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 9 ms | 548 KB | Wrong adjacency |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 504 KB | Expected integer, but "no" found |
2 | Halted | 0 ms | 0 KB | - |