結果
| 問題 |
No.3150 count X which satisfies with equlation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-20 21:40:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,786 bytes |
| コンパイル時間 | 1,654 ms |
| コンパイル使用メモリ | 195,388 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-20 21:40:37 |
| 合計ジャッジ時間 | 2,690 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 34 WA * 7 |
コンパイルメッセージ
In file included from main.cpp:4:
main.cpp: In function ‘int main()’:
main.cpp:18:11: warning: ‘numdig’ may be used uninitialized [-Wmaybe-uninitialized]
18 | rep(i,numdig) {
| ^~~~~~
main.cpp:37:31: note: in definition of macro ‘rep’
37 | #define rep(i,n) for(ll i=0;i<n;i++)
| ^
main.cpp:8:9: note: ‘numdig’ was declared here
8 | int numdig;
| ^~~~~~
ソースコード
#ifndef INCLUDED_MAIN
#define INCLUDED_MAIN
#include __FILE__
int main(){
ll a,b; cin>>a>>b;
int numdig;
ll pp=max(a,b);
rep(dig,70) {
if(modpow(2,dig,0)>pp) {
numdig=pp;
break;
}
}
ll ans=1;
rep(i,numdig) {
if((a>>i)&1) {
if((b>>i)&1) ans*=2;
else {
ans=0;
cout<<ans<<nl;
return 0;
}
}
}
cout<<ans<<nl;
return 0;
}
/////// library zone ///////
#else
#include <bits/stdc++.h>
#include <atcoder/segtree>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define srep(i,l,r) for(ll i=l;i<=r;i++)
using ll = long long;
using ld = long double;
const ll mod=998244353;
#define vout(v) for(auto i :v) cout<<i<<" ";
#define INF 9223300000000000000ll
#define Winf 5e12
#define nl "\n"
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define vl vector<ll>
#define vc vector<char>
ll op(ll a,ll b) {return a+b;}
ll e() {return 0ll;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
void no() { cout<<"No"<<nl;}
void yes() { cout<<"Yes"<<nl;}
void yn(bool a) {
cout<<(a ? "Yes":"No")<<nl;
}
ll sum(vector<ll>& a) {
ll ans=0;
for(auto i:a) ans+=i;
return ans;
}
ll modpow(ll fl, ll po, ll mode) { // mode: 0=modなし, 1=modあり
ll ret=1;
if (mode) {
while (po>0) {
if (po&1) ret=(ret*fl)%mod;
fl=(fl*fl)%mod;
po>>=1;
}
} else {
while (po>0) {
if(po&1) ret*=fl;
fl*=fl;
po>>=1;
}
}
return ret;
}
#endif