結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-02-06 00:58:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 509 bytes |
| コンパイル時間 | 483 ms |
| コンパイル使用メモリ | 64,212 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 08:29:35 |
| 合計ジャッジ時間 | 1,495 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}