# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1021708 | lHog | Monthly railway pass (LMIO18_menesinis_bilietas) | C++17 | 3053 ms | 26456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> veci;
typedef vector<ll> vecll;
#define mp make_pair
#define fi first
#define se second
// debug needs a semicolon !!!
#define debug(x) cerr<<# x<<" is "<<x<<'\n'
#define vec vector
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n, m;
cin >> n >> m;
veci a[n];
for (int i=0; i<n; i++) {
int x;
cin >> x;
a[i].push_back(x);
char USELESS;
cin >> USELESS;
}
queue<int> tv;
tv.push(0);
bool visited[n]={1};
while (!tv.empty()) {
int x = tv.front();
tv.pop();
for (int i=0; i<a[x].size(); i++) {
if (!visited[a[x][i]]) {
tv.push(i);
}
}
}
for (int i=0; i<n; i++) {
if (!visited[i]) {
cout << 0;
return 0;
}
}
cout << n;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |