結果
| 問題 | No.237 作図可能性 |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-02-06 00:58:14 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 304 ms |
| コンパイル使用メモリ | 74,904 KB |
| 実行使用メモリ | 9,808 KB |
| 最終ジャッジ日時 | 2026-09-03 03:35:26 |
| 合計ジャッジ時間 | 2,298 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 28 |
ソースコード
//3~Aの内、0個以上の2,3,5,17,257,65537で割り切ることができる数
#include <iostream>
using namespace std;
int Z[6] = {2,3,5,17,257,65537};
int main(){
int n;cin>>n;
//0~A - 0~2
int ans = 0;
for(int bit = 1; (1<<6) > bit; bit++){
int popcnt = __builtin_popcount(bit);
int mul = 1;
for(int i = 0; 6 > i; i++){
if(bit >> i&1)mul *= Z[i];
}
if(popcnt%2)ans += n/mul;
else ans -= n/mul;
}
cout << ans-1 << endl;
}