Guest User

Untitled

a guest
Jan 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. bool d[1001];
  4. int main(){
  5. int n;
  6. scanf("%d", &n);
  7. d[0] = true;
  8. d[1] = false;
  9. d[2] = true;
  10. d[3] = false;
  11. d[4] = true;
  12. //하나라도 뒤에 애가 이기는 경우의 수 있으면 이기게 됨
  13. for (int i = 5; i <= 1000; i++){
  14. d[i] = false;
  15. if (d[i - 1] == false) d[i] = true;
  16. if (d[i - 3] == false) d[i] = true;
  17. if (d[i - 4] == false) d[i] = true;
  18. }
  19. if (d[n]) printf("SK\n");
  20. else printf("CY");
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment