C题 没开long double导致wa 请教各位大佬
如题 这题没开long double导致最后通过率是百分之九十多,开了就a了,请教各位是什么原因呢 有什么hack数据呀
#include <bits/stdc++.h> using namespace std; typedef long long LL; void solve(){ LL n; cin>>n; LL add = log2((long double)n); // LL add2 = log2(n); // cout<<add<<" "<<add2<<endl; LL last=add; LL res; do{ last=add; res = 2ll*(add+n); add = log2((long double)res)-1; }while (add!=last); cout<<res<<endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; cin>>T; while(T--){ solve(); } return 0; }