Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Safe.h"
- #include <cmath>
- using namespace std;
- TPassword res, t_all;
- long all = 0;
- int main()
- {
- long n,k;
- Init(n, k);
- for (int i = 0; i < n; i++)
- t_all[i] = 1;
- all = Try(t_all);
- res[n-1] = all;
- for (int i = 0; i < n-1; i++)
- {
- t_all[i] = 2;
- res[i] = (all - Try(t_all) + 3) / 2;
- res[n-1] -= (res[i]-1)*(res[i]-1);
- t_all[i] = 1;
- }
- res[n-1] = sqrt(res[n-1])+1;
- Finish(res);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement