답안 #99652

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
99652 2019-03-06T04:18:55 Z adlet Pipes (CEOI15_pipes) C++17
10 / 100
5000 ms 65356 KB
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define ios ios_base::sync_with_stdio(0), cin.tie(0)

using namespace std;

typedef long long ll;

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int INF = 1e9;
const double PI = acos(-1.0);

int n, m, cnt, timer, fup[N], used[N], tin[N];

vector < int > g[N];

inline void dfs(int v, int p = -1) {
    used[v] = 1;
    tin[v] = ++timer;
    fup[v] = timer;
    for (int to : g[v]) {
        if (to == p)
            continue;
        if (used[to])
            fup[v] = min(fup[v], tin[to]);
        if (!used[to]) {
            dfs(to, v);
            fup[v] = min(fup[v], fup[to]);
            if (fup[to] > tin[v])
                cout << v << " " << to << "\n";
        }
    }
}

int main() {
    cin >> n >> m;
    for (int i = 1; i <= m; ++i) {
        int v, u;
        cin >> v >> u;
        g[v].push_back(u);
        g[u].push_back(v);
    }
    for (int i = 1; i <= n; ++i) {
        if (!used[i]) {
            dfs(i);
        }
    }
}
/**
clock() / (double)CLOCKS_PER_SEC < 1.9

*/
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2688 KB Output is correct
2 Incorrect 4 ms 2688 KB Wrong number of edges
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3072 KB Output is correct
2 Incorrect 59 ms 2936 KB Wrong number of edges
# 결과 실행 시간 메모리 Grader output
1 Correct 331 ms 10632 KB Output is correct
2 Correct 347 ms 10088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 630 ms 14060 KB Output is correct
2 Runtime error 749 ms 18668 KB Memory limit exceeded (if you are sure your verdict is not MLE, please contact us)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1165 ms 24620 KB Memory limit exceeded (if you are sure your verdict is not MLE, please contact us)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1772 ms 29148 KB Memory limit exceeded (if you are sure your verdict is not MLE, please contact us)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2882 ms 50696 KB Memory limit exceeded (if you are sure your verdict is not MLE, please contact us)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3921 ms 63748 KB Memory limit exceeded (if you are sure your verdict is not MLE, please contact us)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5058 ms 65356 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5062 ms 56416 KB Time limit exceeded
2 Halted 0 ms 0 KB -