답안 #295989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
295989 2020-09-10T07:00:30 Z Gurban 장난감 기차 (IOI17_train) C++17
0 / 100
10 ms 768 KB
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ss second
#define ff first
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
const ll inf = 1e18;
const int mod = 1e9+7; //998244353;
const int maxn = 1e4+5;
const int Xg[4] = {1,0,-1,0}, Yg[4] = {0,1,0,-1};
ll modpw(ll a,ll e) {if(e==0)return 1;ll x=modpw(a*a%mod,e>>1);return e&1?x*a%mod:x;}

int N,M;
int s[maxn],nx[maxn];

vi who_wins(vi a, vi r, vi u, vi v) {
	N = sz(r),M = sz(u);
	
	for(int i = 0;i < M;i++){
		if(u[i]==v[i]) s[u[i]]=1;
		if(v[i]==u[i]+1) nx[u[i]]=1;
	}

	vi ans;
	for(int i = 0;i < N;i++){
		int now = i;
		bool tr = 0;
		while(1){
			if(s[now]==1){
				if(r[now]==1 and a[now]==1){tr=1;break;}
				if(r[now]==0 and a[now]==0){tr=0;break;}
			}
			if(nx[now]==1) now=now+1;
			else break;
		}

		ans.pb(tr);
	}

	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 640 KB Output is correct
2 Incorrect 4 ms 640 KB 3rd lines differ - on the 4997th token, expected: '1', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB 3rd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 768 KB Output is correct
2 Correct 8 ms 768 KB Output is correct
3 Correct 7 ms 768 KB Output is correct
4 Incorrect 7 ms 768 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 676 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 9 ms 768 KB 3rd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 640 KB Output is correct
2 Incorrect 4 ms 640 KB 3rd lines differ - on the 4997th token, expected: '1', found: '0'
3 Halted 0 ms 0 KB -