結果
| 問題 | No.740 幻の木 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-07-04 00:43:21 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 5 ms / 2,000 ms | 
| コード長 | 252 bytes | 
| コンパイル時間 | 1,877 ms | 
| コンパイル使用メモリ | 193,236 KB | 
| 最終ジャッジ日時 | 2025-01-11 15:15:57 | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n,m,p,q; cin>>n>>m>>p>>q;
	--p,--q;
	int ans=0,i=0;
	while(n>0){
		i%=12;
		if(i<p||i>p+q)n-=m;
		else n-=2*m;
		++i,++ans;
	}
	cout<<ans<<"\n"s;
}
            
            
            
        