답안 #794155

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
794155 2023-07-26T09:58:30 Z alvingogo 장난감 기차 (IOI17_train) C++14
0 / 100
1818 ms 1012 KB
#include "train.h"
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define AquA cin.tie(0);ios_base::sync_with_stdio(0);
#define fs first
#define sc second
#define p_q priority_queue
using namespace std;

typedef long long ll;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
	int n=a.size(),m=u.size();
	vector<int> ans(n);
	vector<ll> dis(n),val(n);
	for(int i=0;i<n;i++){
		if(r[i]==0){
			val[i]=-1;
		}
		else{
			val[i]=1e9;
		}
	}
	for(int i=0;i<n;i++){
		auto dz=dis;
		for(int j=0;j<m;j++){
			ll p=dis[v[j]]+val[v[j]]*(val[v[j]]<0 || v[j]!=u[j]);
			if(a[u[j]]==1){
				dz[u[j]]=max(dz[u[j]],p);
			}
			else{
				dz[u[j]]=min(dz[u[j]],p);
			}
		}
		dis=dz;
	}
	auto dz=dis;
	for(int i=0;i<m;i++){
		for(int j=0;j<m;j++){
			ll p=dis[v[j]]+val[v[j]]*(val[v[j]]<0 || v[j]!=u[j]);
			if(a[u[j]]==1){
				dz[u[j]]=max(dz[u[j]],p);
			}
			else{
				dz[u[j]]=min(dz[u[j]],p);
			}
		}
	}
	for(int i=0;i<n;i++){
		ans[i]=(dz[i]==dis[i]);
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 205 ms 680 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 846 ms 1012 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 761 ms 884 KB 3rd lines differ - on the 696th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1818 ms 1012 KB 3rd lines differ - on the 29th token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 205 ms 680 KB 3rd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -