2006-02-11 Time Limit Exceeded 10.051 440 |
~cpp #include <iostream> using namespace std; int process(int n) { int i = 0, j = 0; int state = 0; for(i = 1; i <= n; i++) // n 번 왕복, { if(n % i == 0) state = ~state; } return state; // 마지막 } int main() { int n; int result = 0; while(1) { cin >> n; if(n == 0) break; result = process(n); if(result == 0) cout << "no" << endl; else cout << "yes" << endl; } return 0; }