답안 #425863

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
425863 2021-06-13T12:04:30 Z Rouge_Hugo 장난감 기차 (IOI17_train) C++14
0 / 100
8 ms 1868 KB
#include<bits/stdc++.h>
#include "train.h"
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;int n,m;
vector<int>ans;
const int N=5090;
int vis[N];
vector<int>v[N];
int r[N];
vector<int> who_wins(vector<int> A,vector<int> R,vector<int> u,vector<int> uu) {
	n=R.size();m=u.size();
	for(int i=0;i<n;i++)
        r[i]=R[i];
    for(int i=0;i<m;i++)
        v[u[i]].pb(uu[i]);
    for(int i=n-1;i>-1;i--)
    {
        if(v[i][0]==i)
        {
            if(R[i])ans.pb(1);
            else ans.pb(0);continue;
        }
        ans.pb(ans.back());
    }
    reverse(ans.begin(),ans.end());
return ans;
}
/*
4 4
0 0 0 0
0 0 0 1
0 1
1 2
2 2
3 3
*/

Compilation message

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:24:13: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   24 |             else ans.pb(0);continue;
      |             ^~~~
train.cpp:24:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
   24 |             else ans.pb(0);continue;
      |                            ^~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 844 KB 3rd lines differ - on the 14th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 588 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 8 ms 1868 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 1612 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 8 ms 1868 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 844 KB 3rd lines differ - on the 14th token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -