#include #include #include #include #include #define MAX 10000 using namespace std; bool isPrime(int n){ if(n == 1){ return false; } if(n == 2){ return true; } bool flag = true; for (int i = 2; i < n; i++) { if(n%i == 0){flag = false;break;} } return flag; } vector returnPrimeList(int n){ vector a; if(n == 1){return a;} a.push_back(2);//2は先に追加しておく for (int i = 3; i <= n; i += 2) { //素数の場合追加 if(isPrime(i)){a.push_back(i);} } return a; } int main(int argc, const char * argv[]) { int n; cin >> n; bool dp[MAX]; vector primes = returnPrimeList(n); for (int i = 0; i < MAX; i++) { dp[i] = false; } dp[0] = true;dp[1] = true; for (int i = 2; i <= n; i++) { for (int j: primes) { if(i-j < 0)break; dp[i] = (dp[i]| !dp[i-j]); } } if(dp[n])cout << "Win\n"; else cout << "Lose\n"; }