結果

問題 No.1101 鼻水
ユーザー mamimume____momamimume____mo
提出日時 2020-07-07 21:51:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,004 bytes
コンパイル時間 913 ms
コンパイル使用メモリ 84,592 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 20:24:43
合計ジャッジ時間 1,659 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 WA -
testcase_08 AC 1 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 2 ms
6,940 KB
testcase_11 WA -
testcase_12 AC 1 ms
6,940 KB
testcase_13 WA -
testcase_14 AC 2 ms
6,944 KB
testcase_15 WA -
testcase_16 AC 1 ms
6,944 KB
testcase_17 WA -
testcase_18 AC 2 ms
6,940 KB
testcase_19 WA -
testcase_20 AC 2 ms
6,940 KB
testcase_21 WA -
testcase_22 AC 2 ms
6,944 KB
testcase_23 WA -
testcase_24 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <deque>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const int MOD = 1000000007;

ll v,t,p;
bool check(ll mid){
	//mid秒を達成出来るかどうか.
	if(mid / t >= mid - v * (p+1)){
		return true;
	}

	return false;
}

int main(){
	cin >> v >> t >> p;

	//まず,v*(p+1)は少なくとも達成出来る.
	//鼻をすする場合は,容量v*(p+1)のとき何回すすれるかを考える.(瞬時にすすれることを考慮するとOK)
	//伸ばせる時間は,2分探索?
	ll ans = v * (p + 1);

	ll ng = 2e18;
	ll ok = 0;
	while(ng - ok > 1){
		ll mid = (ok + ng) / 2;
		if(check(mid)){
			ok = mid;
		}
		else ng = mid;
	}

	cout << ok + 1 << endl;
}
0