답안 #402830

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
402830 2021-05-12T12:05:20 Z kshitij_sodani 장난감 기차 (IOI17_train) C++14
5 / 100
59 ms 1268 KB
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
#define endl '\n'

#include "train.h"
vector<int> adj[5001];

vector<int> who_wins(vector<int> aa, vector<int> bb,vector<int> uu,vector<int> vv) {
	int n=aa.size();
	int m=uu.size();
	for(int i=0;i<m;i++){
		adj[uu[i]].pb(vv[i]);
	}
	vector<int> ans;
	for(int i=0;i<n;i++){
		ans.pb(0);
		for(int j=i;j<n;j++){
			int st=0;
			int st2=0;
			for(auto ii:adj[j]){
				if(ii==j){
					st=1;
				}
				if(ii==j+1){
					st2=1;
				}
			}
			if(st==1){
				if(st2==0){
					if(bb[j]==1){
						ans[i]=1;
					}
					else{

					}
					break;
				}
				if(aa[j]==0){
					if(bb[j]==0){
						break;
					}
				}
				if(aa[j]==1 and bb[j]==1){

					ans[i]=1;
					break;
				}
			}
		}
	}



	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 844 KB Output is correct
2 Correct 5 ms 844 KB Output is correct
3 Correct 4 ms 844 KB Output is correct
4 Correct 4 ms 844 KB Output is correct
5 Correct 5 ms 844 KB Output is correct
6 Correct 5 ms 844 KB Output is correct
7 Correct 5 ms 844 KB Output is correct
8 Correct 4 ms 844 KB Output is correct
9 Correct 4 ms 844 KB Output is correct
10 Correct 6 ms 844 KB Output is correct
11 Correct 6 ms 844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 1268 KB Output is correct
2 Correct 57 ms 1196 KB Output is correct
3 Correct 59 ms 1268 KB Output is correct
4 Incorrect 34 ms 1248 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 52 ms 1060 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 32 ms 1256 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 844 KB Output is correct
2 Correct 5 ms 844 KB Output is correct
3 Correct 4 ms 844 KB Output is correct
4 Correct 4 ms 844 KB Output is correct
5 Correct 5 ms 844 KB Output is correct
6 Correct 5 ms 844 KB Output is correct
7 Correct 5 ms 844 KB Output is correct
8 Correct 4 ms 844 KB Output is correct
9 Correct 4 ms 844 KB Output is correct
10 Correct 6 ms 844 KB Output is correct
11 Correct 6 ms 844 KB Output is correct
12 Incorrect 1 ms 332 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
13 Halted 0 ms 0 KB -