제출 #95182

#제출 시각아이디문제언어결과실행 시간메모리
95182Osama_AlkhodairyHidden Sequence (info1cup18_hidden)C++17
34 / 100
8 ms376 KiB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;

vector < int > findSequence (int N){
    vector <int> ans;
    while((int)ans.size() < N){
        ans.push_back(1);
        if(isSubsequence(ans) == 0){
            ans.pop_back();
            break;
        }
    }
    for(int i = 0 ; i < N ; i++){
        if(ans.size() == N) break;
        ans.insert(ans.begin() + i, 0);
        if(isSubsequence(ans) == 0)
            ans.erase(ans.begin() + i);
    }
    return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

hidden.cpp: In function 'std::vector<int> findSequence(int)':
hidden.cpp:15:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(ans.size() == N) break;
            ~~~~~~~~~~~^~~~
grader.cpp: In function 'int main()':
grader.cpp:28:43: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
     fprintf (fifo_out, "%d\n", ans.size ());
                                ~~~~~~~~~~~^
grader.cpp:29:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<ans.size () && i < N; i++)
                   ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...