| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1362099 | maya_s | 장난감 기차 (IOI17_train) | C++20 | 2 ms | 836 KiB |
#include "train.h"
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
ll n = a.size(), m = u.size();
vector<bool> self_loop(n), next_connection(n);
for(ll i = 0; i < m; i++){
if(u[i] == v[i]) self_loop[u[i]] = 1;
else next_connection[u[i]] = 1;
}
vector<ll> ans(n); ans[n-1] = a[n-1];
for(ll i = n-2; i >= 0; i--) ans[i] = (self_loop[i] && a[i]) || (ans[i+1] && next_connection[i]);
return ans;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
