제출 #1207846

#제출 시각아이디문제언어결과실행 시간메모리
1207846lopkusHidden Sequence (info1cup18_hidden)C++20
0 / 100
1022 ms420 KiB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;

vector < int > findSequence (int N) {
  std::vector<int> ans;
  while(ans.size() != N) {
    int ok = 0;
    for(int t = 0; t < 2&& !ok; t++) {
      for(int s = 0; s < 2 && !ok; s++) {
        if(t == 0) {
          std::vector<int> b;
          b.push_back(s);
          for(int i = 0; i < ans.size(); i++) {
            b.push_back(ans[i]);
          }
          if(isSubsequence(b)) {
            ok = 1;
            ans = b;
            break;
          }
        }
        else {
          std::vector<int> b = ans;
          b.push_back(s);
          if(isSubsequence(b)) {
            ok = 1;
            ans = b;
            break;
          }
        }
      }
    }
  }
  return ans;
}

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

grader.cpp: In function 'int main()':
grader.cpp:28:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
   28 |     fprintf (fifo_out, "%d\n", ans.size ());
      |                         ~^     ~~~~~~~~~~~
      |                          |              |
      |                          int            std::vector<int>::size_type {aka long unsigned int}
      |                         %ld
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...