Submission #434494

# Submission time Handle Problem Language Result Execution time Memory
434494 2021-06-21T11:12:15 Z medmdg Toy Train (IOI17_train) C++14
0 / 100
8 ms 1100 KB
#include<bits/stdc++.h>
#include "train.h"
#define ll  int
using namespace std;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
        vector<ll> win;
        for(int i=0;i<u.size();i++){
            if(u[i]==v[i]){
                if(r[i]){
                    if(a[i])
                        while(win.size()<i)
                            win.push_back(1);
                }else{
                    if(!a[i])
                        win.push_back(0);
                }
            }
        }
        while(win.size()<u.size()){
            win.push_back(1-a[a.size()-1]);
        }
        return win;
}


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:7:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |         for(int i=0;i<u.size();i++){
      |                     ~^~~~~~~~~
train.cpp:11:41: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |                         while(win.size()<i)
      |                               ~~~~~~~~~~^~
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 460 KB WA in grader: Wrong returned array size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB WA in grader: Wrong returned array size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 844 KB WA in grader: Wrong returned array size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 696 KB WA in grader: Wrong returned array size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1100 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 460 KB WA in grader: Wrong returned array size
2 Halted 0 ms 0 KB -