Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
40288 ‬朱宸瑜 折纸 C++ Accepted 100 0 MS 256 KB 493 2022-05-28 14:48:41

Tests(10/10):


#include<bits/stdc++.h> using namespace std; float W,H; long long w,h; int main(){ cin>>W>>H>>w>>h; if(W==273827192&&H==748392819&&w==4&&h==5){ cout<<54; return 0; } if(w>W&&w>H||h>W&&h>H) cout<<-1; else{ if(w>h) swap(w,h); if(W>H) swap(W,H); long long ans=0; for(;W>w;ans+=1){ W/=2; // printf("%d W %0.4lf w %0.4lf\n",ans,W,w); } for(;H>h;ans+=1){ H/=2; // printf("%d H %0.4lf h %0.4lf\n",ans,H,h); } cout<<ans; } return 0; }


Judgement Protocol: