fork download
  1. #include <iostream>
  2. using namespace std;
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6.  
  7. typedef unsigned char uchar;
  8. //typedef unsigned long long ulong;
  9.  
  10. int check(uchar * pwd)
  11. {
  12. uchar a[] = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
  13. int d = strlen((char*)a), i, j;
  14. for (i = 0, j = strlen((char*)pwd); i < j; i++) {
  15. if (strchr((char*)a, (char)pwd[i]) == NULL) pwd[i] = a[pwd[i] % d];
  16. if (i > 0) pwd[i - 1] = a[(((pwd[i - 1] ^ pwd[i]) << 1) * pwd[i]) % d];
  17. }
  18. return !strcmp((char*)pwd, "Tp9?k=HDN&nD{9 ~JzUYG3h>lF {`> K<% pm~J>y E=2B=y+<x+nf@*%kDZ;z/'WYbWOk'usw>Z");
  19. }
  20. int main(int argc, char ** argv)
  21. {
  22. uchar pwd[256]="AeMzQ8oZk31W4B(L\\1Uh$,9m</cZeQ\"LBygghYTC7QQMwY8otyMNobKExaZ181d<@U'S{@7cNqJZ";
  23. printf("Result: %s\n", check((uchar*)pwd) ? "OK" : "FAIL");
  24. return 0;
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Result: OK