제출 #1235683

#제출 시각아이디문제언어결과실행 시간메모리
1235683AishaHidden Sequence (info1cup18_hidden)C++20
0 / 100
18 ms416 KiB
#include "bits/stdc++.h" #include "grader.h" using namespace std; vector <int> findSequence(int n) { vector <int> ans; int cnt0 = 0, cnt1 = 0; vector <int> q; for (int i = 1; i <= n; i ++) { q.push_back(0); bool ok = isSubsequence(q); if (ok) cnt0 ++; else break; } cnt1 = n - cnt0; //cout << cnt0 << ' ' << cnt1 << endl; q.clear(); int x = 1; q.push_back(0); while (cnt1 > 0) { int k = 0; for (int i = 1; i <= cnt1; i ++) { q.push_back(1); // for (int j : q) cout << j << ' '; // cout << endl; bool ok = isSubsequence(q); // cout << ok << endl; if (ok) k ++; else break; } for (int i = 1; i <= cnt1 - k; i ++) ans.push_back(1); ans.push_back(0); x ++; q.clear(); for (int i = 1; i <= x; i ++) q.push_back(0); cnt1 = k; } for (int i = x + 1; i <= cnt0; i ++) ans.push_back(0); 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...