結果
| 問題 |
No.3023 Utility is Max?
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 13:33:47 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 544 bytes |
| コンパイル時間 | 549 ms |
| コンパイル使用メモリ | 68,600 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-12 13:40:03 |
| 合計ジャッジ時間 | 2,367 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 17 |
ソースコード
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main() {
int N;
cin >> N;
if (N < string("aa").size()) {
cout << "NO" << endl;
exit(EXIT_SUCCESS);
}
string s = "aa";
bool is_prime = true;
while (s.size() < N) {
if (N % s.size() == 0) {
is_prime = false;
break;
}
s.append(1, 'a');
}
if (is_prime) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
exit(EXIT_SUCCESS);
}
gew1fw