Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <string>
- #include <cmath>
- #include <set>
- #include <map>
- using namespace std;
- int main()
- {
- int n,m,k;
- cin>>n>>k>>m;
- string real_ans;
- cin>>real_ans;
- int N = n * 2;
- string ans="", A(k, '2') , C(m, '0');
- string to9 = "";
- if (N - k - m > 0){
- int B_sz = N - k - m;
- if (B_sz % 2 == 1){
- B_sz--;
- }
- string B(B_sz, '1');
- ans = A + B + C;
- }
- else{
- ans = A + C;
- }
- if ((int)ans.size() % 2 == 1) ans = '0' + ans;
- //cout<<ans<<'\n';
- reverse(ans.begin(), ans.end());
- for (int i = 0; i < N; i += 2){
- int nxt = (ans[i] - '0') + (ans[i+1] - '0') * 3;
- char l = nxt + 48;
- //cout<<"l = "<<l<<'\n';
- to9 += l;
- }
- reverse(to9.begin(), to9.end());
- cout<<to9<<'\n';
- if (to9 == real_ans) cout<<"OK\n";
- else cout<<"F*ckU\n";
- }
- /*
- 70 20 30
- 8888888888444444444444444444444444444444444444444444444000000000000000
- 70 21 30
- 2888888888844444444444444444444444444444444444444444444000000000000000
- */
Add Comment
Please, Sign In to add comment