結果
| 問題 |
No.1452 XOR×OR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-16 22:11:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 427 bytes |
| コンパイル時間 | 2,176 ms |
| コンパイル使用メモリ | 166,224 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 15:38:47 |
| 合計ジャッジ時間 | 2,704 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll N; cin>>N;
ll ans=0;
for(ll x=1;x*x<=N;x++){
if(N%x==0){
ll o=N/x;
ll cnt=1;
for(int i=0;i<40;i++){
if(((x>>i)&1)==1 && ((o>>i)&1)==0)cnt=0;
if(((x>>i)&1)==1 && ((o>>i)&1)==1)cnt*=2;
}
ans+=cnt;
}
}
cout<<ans/2<<endl;
}