제출 #1126155

#제출 시각아이디문제언어결과실행 시간메모리
1126155Captain_GeorgiaHidden Sequence (info1cup18_hidden)C++20
24 / 100
6 ms428 KiB
#include<bits/stdc++.h> #include "grader.h" using namespace std; vector<int> findSequence (int N) { int low = 0, high = N + 1; while (low < high) { int mid = (low + high + 1) / 2; vector<int> tmp(mid, 0); if (isSubsequence (tmp) == true) { low = mid; } else { high = mid - 1; } } vector<int> answer; int cnt_zero = low; N -= low; for (int i = 0;i <= cnt_zero;i ++) { low = 0; high = N + 1; while (low < high) { int mid = (low + high + 1) / 2; vector<int> tmp; for (int j = 0;j < i;j ++) { tmp.push_back(0); } for (int j = 0;j < mid;j ++) { tmp.push_back(1); } for (int j = i;j < cnt_zero;j ++) { tmp.push_back(0); } if (isSubsequence (tmp) == true) { low = mid; } else { high = mid - 1; } } for (int j = 0;j < low;j ++) { answer.push_back(1); } if (i < cnt_zero) answer.push_back(0); N -= low; } return answer; }

컴파일 시 표준 에러 (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...