結果

問題 No.8130 プラチナバッハ問題
コンテスト
ユーザー toku4388
提出日時 2026-04-01 22:57:24
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 96 ms / 6,000 ms
コード長 1,196 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,440 ms
コンパイル使用メモリ 331,352 KB
実行使用メモリ 339,196 KB
最終ジャッジ日時 2026-04-01 22:57:31
合計ジャッジ時間 4,650 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
small 10 % AC * 12
large 90 % AC * 18
合計 2.5 * 100% = 250 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct sieve {
	vector<int> s;
	sieve(int n) : s(n + 1) {
		for (ll i = 0; i <= n; i++) {
			s[i] = i;
		}
		for (ll i = 2; i <= n; i++) {
			if (s[i] == i) {
				for (ll j = i * i; j <= n; j += i) {
					if (s[j] == j) {
						s[j] = i;
					}
				}
			}
		}
	}
	vector<pair<int, int>> primeFac(int n) {
		vector<pair<int, int>> res;
		while (n != 1) {
			int p = s[n], cnt = 0;
			while (s[n] == p) {
				n /= p;
				cnt++;
			}
			res.push_back(pair<int, int>(p, cnt));
		}
		return res;
	}
	bool isPrime(int n) {
		if (n <= 1) return false;
		return (s[n] == n);
	}
};
int main() {
	int tt;
	cin >> tt;
	// const int M = 100000;
	// vector<bool> dp(M, false);
	// dp[0] = true;
	// sieve s(M);
	// for (int i = 0; i < M; i++) {
	// 	if (s.isPrime(i)) {
	// 		for (int j = M - 1; j >= 0; j--) {
	// 			if (dp[j] && j + i < M) {
	// 				dp[j + i] = true;
	// 			}
	// 		}
	// 	}
	// }
	// for (int i = 10; i < M; i++) {
	// 	assert(dp[i]);
	// }
	// cout << "OK" << endl;
	while (tt--) {
		int n;
		cin >> n;
		if (n == 1 || n == 4 || n == 6) {
			cout << "No" << endl;
		} else {
			cout << "Yes" << endl;
		}
	}
	return 0;
}
0