結果

問題 No.740 幻の木
ユーザー magmag
提出日時 2020-07-06 12:54:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,025 bytes
コンパイル時間 1,514 ms
コンパイル使用メモリ 166,772 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 22:02:38
合計ジャッジ時間 2,156 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  //$B$"$kB<$K$O!"B<?M$+$i88$NLZ$H8F$P$l$kLZ$,$"$j$^$9!#(B
  //$B$3$NLZ$O@.D9$7$-$k$H(BN$BKg$NMU$r$D$1$^$9$,!"(B
  //$B$=$N8e$O(B1$B%v7n$4$H$K(BM$BKg$NMU$rMn$H$7$F$$$-!"$$$:$lA4$F$NMU$rMn$H$7$-$l$P!"(B
  //$B$b$&FsEY$HMU$rIU$1$k$3$H$O$"$j$^$;$s!#(B 
  //$B$5$i$K!"$3$NB<$G$O(BQ$B%v7n4V$N!VIw$N6/$$4|4V!W$,$"$j!"(B
  //$BKhG/(BP$B7n$+$i;O$^$k$3$N4|4VCf$O!"88$NLZ$O(B2$B!_(BM$BKg$NMU$rMn$H$7$F$7$^$$$^$9!#(B
  //$B$3$NB<$G$O(B1$B7n$N:#!"$A$g$&$I88$NLZ$,@.D9$7$-$j$^$7$?!#(B
  //$BMU$rA4$FMn$H$9$N$O2?$+7nL\$+=PNO$7$F$/$@$5$$!#(B
  int n,m,p,q,cnt=0;cin>>n>>m>>p>>q;
  q=p+q-1;
  for(;n>0;){
    if(cnt>=p&&cnt<=q){
      n-=m*2;
      if(n<=0){
        break;
      }
    }else{
      n-=m;
    }
    cnt++;
    //cout<<cnt<<" "<<p<<" "<<q<<" "<<n<<endl;
  }
  cout<<cnt<<endl;
}
0