結果
問題 |
No.1452 XOR×OR
|
ユーザー |
![]() |
提出日時 | 2021-04-01 02:47:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 430 bytes |
コンパイル時間 | 3,790 ms |
コンパイル使用メモリ | 191,416 KB |
最終ジャッジ日時 | 2025-01-20 04:46:13 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 4 WA * 32 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ int N; cin>>N; int ans=0; for(int 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; }