結果

問題 No.604 誕生日のお小遣い
ユーザー 41Toame41Toame
提出日時 2018-09-09 12:12:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 775 bytes
コンパイル時間 1,960 ms
コンパイル使用メモリ 144,208 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-08-24 18:23:49
合計ジャッジ時間 6,317 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int A, B, C;
	cin >> A >> B >> C;
	int ok = C / (B / A/2), ng = 0;
	while ((ok - ng) != 1) {
		int mid = (ok + ng) / 2;
		int money = mid + (mid / A) * (B - 1);
		cout << mid << " " << money << endl;
		if (money >= C) ok = mid;
		else ng = mid;
	}
	cout << ok << endl;

    return 0;
}
0