結果

問題 No.740 幻の木
ユーザー gazellegazelle
提出日時 2018-10-05 22:51:01
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 727 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 193,364 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 17:25:43
合計ジャッジ時間 2,638 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
}
0