結果
| 問題 | No.740 幻の木 | 
| コンテスト | |
| ユーザー |  gazelle | 
| 提出日時 | 2018-10-05 22:51:01 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 727 bytes | 
| コンパイル時間 | 1,567 ms | 
| コンパイル使用メモリ | 192,356 KB | 
| 最終ジャッジ日時 | 2025-01-06 14:20:00 | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 | 
ソースコード
#include<bits/stdc++.h>
#include<random>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007LL
#define INF 1000000000LL
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m,p,q;
	cin>>n>>m>>p>>q;
	ll ans=1,mnt=1;
	while(1) {
		if(mnt>=p&&mnt<p+q) n-=2*m;
		else n-=m;
		if(n>0) ans++;
		else break;
		mnt+=1;
		if(mnt==13) mnt=1;
	}
	cout<<ans<<endl;
	return 0;
}
            
            
            
        