結果

問題 No.740 幻の木
コンテスト
ユーザー chocorusk
提出日時 2018-10-05 21:56:06
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 3 ms / 2,000 ms
+ 220µs
コード長 552 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 547 ms
コンパイル使用メモリ 108,264 KB
実行使用メモリ 9,864 KB
最終ジャッジ日時 2026-10-14 20:39:34
合計ジャッジ時間 1,682 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
   
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n, m, p, q;
	cin>>n>>m>>p>>q;
	for(int i=1; ; i++){
		int i0=i%12;
		if(i0==0) i0=12;
		if(p<=i0 && i0<=p+q-1) n-=(2*m);
		else n-=m;
		if(n<=0){
			cout<<i<<endl;
			return 0;
		}
	}
    return 0;
}
0