結果
問題 |
No.3150 count X which satisfies with equlation
|
ユーザー |
|
提出日時 | 2025-05-20 21:46:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 498 bytes |
コンパイル時間 | 1,439 ms |
コンパイル使用メモリ | 161,624 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-06-20 02:59:53 |
合計ジャッジ時間 | 2,578 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 42 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define REP(i,n) for(ll i=0;i<ll(n);i++) int main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll i,j; ll A,B; cin >> A >> B; vector<ll> a(8,0),b(8,0); for(j=0;j<8;j++){ if(A&(1LL<<j)) a[j]=1; if(B&(1LL<<j)) b[j]=1; } ll ans=1; REP(i,8){ if(a[i]==1 && b[i]==1) ans*=2; else if(a[i]==1 && b[i]==0) ans*=0; } cout << ans << endl; return 0; }