제출 #172646

#제출 시각아이디문제언어결과실행 시간메모리
172646emil_physmath"The Lyuboyn" code (IZhO19_lyuboyn)C++17
11 / 100
775 ms26004 KiB
#include <algorithm> #include <vector> #include <string> #include <iostream> using namespace std; vector<string> a; void Get(int n, int k) { // cerr << n << ", " << k << endl; if (k == 1) { if (n == 1) { a.resize(2); a[0] = "0"; a[1] = "1"; return; } Get(n - 1, k); a.resize(2 * a.size()); for (int i = 0; i < a.size(); ++i) { a[i].insert(a[i].begin(), (i < a.size() / 2 ? '0' : '1')); a[i].resize(n); } for (int j = 1; j < n; ++j) for (int r = a.size() / 2, l = a.size() / 2 - 1; r < a.size(); ++r, --l) a[r][j] = a[l][j]; } } int main() { int n, k, t; cin >> n >> k >> t; string s; cin >> s; Get(n, k); cout << a.size() << endl; for (auto it = find(a.begin(), a.end(), s); it != a.end(); ++it) cout << *it << endl; for (int i = 0; a[i] != s; ++i) cout << a[i] << endl; }

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

lyuboyn.cpp: In function 'void Get(int, int)':
lyuboyn.cpp:23:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = 0; i < a.size(); ++i)
                         ~~^~~~~~~~~~
lyuboyn.cpp:25:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             a[i].insert(a[i].begin(), (i < a.size() / 2 ? '0' : '1'));
                                        ~~^~~~~~~~~~~~~~
lyuboyn.cpp:29:64: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int r = a.size() / 2, l = a.size() / 2 - 1; r < a.size(); ++r, --l)
                                                              ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...