답안 #757154

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
757154 2023-06-12T17:52:14 Z alexander707070 장난감 기차 (IOI17_train) C++14
0 / 100
11 ms 3568 KB
#include<bits/stdc++.h>
#define MAXN 100007
using namespace std;
 
int n,m,curr,res[MAXN];
bool good[MAXN],special[MAXN],pr[MAXN];
vector<int> v[MAXN],ans;

vector<int> who_wins(vector<int> A,vector<int> R, vector<int> from,vector<int> to){
    n=int(A.size()); m=int(from.size());
    
    for(int i=1;i<=n;i++){
        if(A[i-1]==1)good[i]=true;
        if(R[i-1]==1)special[i]=true;
    }

    for(int i=0;i<m;i++){
        if(from[i]==to[i])pr[i]=true;
        v[from[i]].push_back(to[i]);
    }

    for(int i=n;i>=1;i--){
        if(pr[i]){
            if(good[i])curr=1;
            else curr=0;
        }
        res[i]=curr;
    }

    for(int i=1;i<=n;i++){
        ans.push_back(res[i]);
    }

    return ans;
}



# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 3180 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2644 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 3568 KB Output is correct
2 Correct 11 ms 3540 KB Output is correct
3 Correct 8 ms 3540 KB Output is correct
4 Incorrect 8 ms 3540 KB 3rd lines differ - on the 879th token, expected: '0', found: '1'
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 3308 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 3564 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 3180 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -