답안 #681614

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
681614 2023-01-13T13:08:20 Z Karuk "The Lyuboyn" code (IZhO19_lyuboyn) C++14
19 / 100
1000 ms 23216 KB
#include<bits/stdc++.h>
using namespace std;
int main() {
    int n,k,t;cin>>n>>k>>t;
    string s;cin>>s;
    if(k%2==0){cout<<-1;return 0;}
    if(t==1) {
        deque<string>v;
        vector<int>st;
        st.push_back(0);
        for(int i=1;i<n;i++) {
            vector<int>t=st;
            reverse(t.begin(),t.end());
            st.push_back(i);
            for(int j:t)st.push_back(j);
        }
        string cur;
        for(int i=0;i<n;i++)cur+='0';
        v.push_back(cur);
        for(int i=0;i<st.size();i++) {
            int ind=st[i];
            for(int q=0;q<k;q++) {
                if(cur[ind]=='0')cur[ind]='1';
                else cur[ind]='0';
                ind--;
                if(ind<0)ind+=n;
            }
            v.push_back(cur);
        }
        while(v.front()!=s){v.push_back(v.front());v.pop_front();}
        cout<<(1<<n)<<endl;
        for(string ss:v)cout<<ss<<endl;
    } else {
        cout<<-1;return 0;
    }
    return 0;
}

Compilation message

lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         for(int i=0;i<st.size();i++) {
      |                     ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Ok
2 Correct 1 ms 212 KB Ok
3 Correct 1 ms 212 KB Ok
4 Correct 1 ms 212 KB Ok
5 Correct 1 ms 212 KB Ok
6 Correct 1 ms 212 KB Ok
7 Correct 1 ms 212 KB Ok
8 Correct 1 ms 212 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Correct 343 ms 23092 KB Ok
2 Correct 166 ms 11584 KB Ok
3 Correct 2 ms 340 KB Ok
4 Correct 1 ms 212 KB Ok
5 Correct 1 ms 212 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output -1 while solution exists
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output -1 while solution exists
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 343 ms 23092 KB Ok
2 Correct 166 ms 11584 KB Ok
3 Correct 2 ms 340 KB Ok
4 Correct 1 ms 212 KB Ok
5 Correct 1 ms 212 KB Ok
6 Incorrect 0 ms 212 KB Output -1 while solution exists
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 181 ms 11560 KB Ok
2 Correct 375 ms 23176 KB Ok
3 Correct 366 ms 23216 KB Ok
4 Correct 23 ms 1100 KB Ok
5 Correct 1 ms 304 KB Ok
6 Correct 41 ms 2076 KB Ok
7 Correct 341 ms 23064 KB Ok
8 Execution timed out 1083 ms 340 KB Time limit exceeded
9 Halted 0 ms 0 KB -