結果

問題 No.1465 Archaea
ユーザー Kanten4205
提出日時 2020-07-27 22:33:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 69,248 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 20:24:56
合計ジャッジ時間 1,301 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
	long long N; cin >> N;
	vector<bool>A(N + 1, false);
	A.at(0) = true; A.at(1) = true;
	for (long long i = 2; i <= N; i++) {
		if (i % 2 == 0) {
			if (A.at(i / 2)) A.at(i) = true;
			else if (i > 3) {
				if (A.at(i - 3)) A.at(i) = true;
			}
		}
		else {
			if (i > 3) {
				if (A.at(i - 3)) A.at(i) = true;
			}
		}
	}
	if (A.at(N)) cout << "YES" << endl;
	else cout << "NO" << endl;
}
0