結果

問題 No.604 誕生日のお小遣い
ユーザー creep04creep04
提出日時 2017-12-04 06:06:07
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 1,271 ms
コンパイル使用メモリ 156,884 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-06 09:32:02
合計ジャッジ時間 2,338 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

long long a, b, c, upp, low, mid;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	
	cin >> a >> b >> c;
	upp = c, low = 1;
	while (upp-low>1) {
		mid = (upp+low)/2;
		long long tmp = mid/a*b + mid - mid/a;
		if (tmp<c) low = mid;
		else if (tmp>=c) upp = mid;
	}
	cout << upp << "\n";
}
0