結果

問題 No.1010 折って重ねて
ユーザー mfbgjsczmfbgjscz
提出日時 2019-11-01 18:22:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,270 bytes
コンパイル時間 1,620 ms
コンパイル使用メモリ 172,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 19:19:58
合計ジャッジ時間 2,897 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 2 ms
6,944 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 AC 2 ms
6,940 KB
testcase_39 AC 2 ms
6,940 KB
testcase_40 AC 2 ms
6,940 KB
testcase_41 AC 2 ms
6,940 KB
testcase_42 AC 2 ms
6,940 KB
testcase_43 AC 2 ms
6,944 KB
testcase_44 AC 2 ms
6,940 KB
testcase_45 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(150) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int attack(int A,int B){
  if(!A||!B)return -1;
  else return (A+B)%5;
}
pint marge(int A,int B,bool C){
  int P=A+B;
  if(C&&P<4||C&&P==5||P==0)return pint(-1,-1);
  else{
    if(!C&&P>5)P%=5;
    if(!C){
      if(P==1)A=1;
      else if(P==2)if(A==1)A=2;else A=1;
      else if(P==3)if(A==0||A==3)A=2;else A=3;
      else if(P==4)if(A==2||A%2==1)A=4;else A=2;
      else if(P==5)if(A==2||A==3)A=4;else A=3;
    }else{
      if(P==4)if(A%2==0)A=3;else A=2;
      else if(P==6)if(A%2==0)A=3;else A=4;
      else if(P==7)A=P=2;
      else if(P==8){A=2;P=3;}
    }
    return pint(A,P-A);
  }
}
tuple<int,int,int,int> solve(int L1,int R1,int L2,int R2,int E,int flag){
  if(!E)if(!flag)L2=attack(L1,L2);else L1=attack(L1,L2);
  else if(E==1)if(!flag)R2=attack(L1,R2);else L1=attack(L1,R2);
  else if(E==2)if(!flag)L2=attack(R1,L2);else R1=attack(R1,L2);
  else if(E==3)if(!flag)R2=attack(R1,R2);else R1=attack(R1,R2);
  else if(E==4)if(!flag)pint(L1,L2)=marge(L1,L2,0);else pint(R1,R2)=marge(R1,R2,0);
  else if(E==5)if(!flag)pint(L1,L2)=marge(L1,L2,1);else pint(R1,R2)=marge(R1,R2,1);
  return make_tuple(L1,R1,L2,R2);
}
int main(){
  lli A,B,C,D,E,F,N,M,K,L,R,X,Y,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> X >> Y >> H;
  long double x=1000*X,y=1000*Y;
  while(x>H||y>H){
    if(x>y)if(y>H)y/=2;else x/=2;
    else if(y>=x)if(x>H)x/=2;else y/=2;
    sum++;
    H*=2;
  }
  Out(sum);
}
0