# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1068255 | 2024-08-21T08:52:09 Z | edogawa_something | 장난감 기차 (IOI17_train) | C++17 | 16 ms | 1628 KB |
#include "train.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pii; typedef vector<ll> vii; #define F first #define S second #define all(v) v.begin(),v.end() #define pb push_back vii adj[5001],radj[5001]; vector<int>a,r,answer; ll dfs(ll x) { if(adj[x].size()==1) { if(adj[x][0]==x) return r[x]; else return dfs(x+1); } if((a[x]^r[x])) return dfs(x+1); return a[x]; } vector<int> who_wins(std::vector<int> A, std::vector<int> R, std::vector<int> u, std::vector<int> v) { a=A,r=R; for(int i=0;i<u.size();i++) adj[u[i]].pb(v[i]); for(int i=0;i<a.size();i++) { answer.pb(dfs(i)); } return answer; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1112 KB | Output is correct |
2 | Correct | 3 ms | 1116 KB | Output is correct |
3 | Correct | 3 ms | 1116 KB | Output is correct |
4 | Correct | 2 ms | 1116 KB | Output is correct |
5 | Correct | 2 ms | 1104 KB | Output is correct |
6 | Correct | 4 ms | 1112 KB | Output is correct |
7 | Correct | 2 ms | 1116 KB | Output is correct |
8 | Correct | 3 ms | 1112 KB | Output is correct |
9 | Correct | 2 ms | 1116 KB | Output is correct |
10 | Correct | 4 ms | 1116 KB | Output is correct |
11 | Correct | 3 ms | 1116 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 604 KB | 3rd lines differ - on the 2nd token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 16 ms | 1452 KB | Output is correct |
2 | Correct | 12 ms | 1628 KB | Output is correct |
3 | Correct | 12 ms | 1628 KB | Output is correct |
4 | Incorrect | 5 ms | 1628 KB | 3rd lines differ - on the 877th token, expected: '1', found: '0' |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 1116 KB | 3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 1372 KB | 3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1112 KB | Output is correct |
2 | Correct | 3 ms | 1116 KB | Output is correct |
3 | Correct | 3 ms | 1116 KB | Output is correct |
4 | Correct | 2 ms | 1116 KB | Output is correct |
5 | Correct | 2 ms | 1104 KB | Output is correct |
6 | Correct | 4 ms | 1112 KB | Output is correct |
7 | Correct | 2 ms | 1116 KB | Output is correct |
8 | Correct | 3 ms | 1112 KB | Output is correct |
9 | Correct | 2 ms | 1116 KB | Output is correct |
10 | Correct | 4 ms | 1116 KB | Output is correct |
11 | Correct | 3 ms | 1116 KB | Output is correct |
12 | Incorrect | 0 ms | 604 KB | 3rd lines differ - on the 2nd token, expected: '1', found: '0' |
13 | Halted | 0 ms | 0 KB | - |