// http://www.spoj.com/problems/BEENUMS/
#include <iostream>
using namespace std;
int main() {
long cells;
cin >> cells;
while (cells != -1) {
if (cells == 1) {
cout << "Y" << endl;
} else {
int count = 1;
int piece = 6;
while (count < cells) {
count += piece;
piece += 6;
}
if (count == cells) {
cout << "Y" << endl;
} else {
cout << "N" << endl;
}
}
cin >> cells;
}
}
SPOJ BEENUMS
最新推荐文章于 2022-08-23 16:32:57 发布