結果

問題 No.604 誕生日のお小遣い
ユーザー NiwakaNiwaka
提出日時 2020-09-24 12:53:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,402 bytes
コンパイル時間 979 ms
コンパイル使用メモリ 80,688 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-10 13:25:09
合計ジャッジ時間 1,874 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#include<queue>
#include <sstream>
#include <set>
#include<stack>
#include <utility>
#include <tuple>
#define INF 1000000000000
const long long MOD = 998244353;

using namespace std;
typedef long long llong;
#define debug cout << "Hello" << endl;
//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//Insert()	(指定した場所に)文字・文字列を挿入する
//erase()	(指定した場所の)文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の(指定した)部分文字列を返す
//replace()	(指定した)部分文字列を新しい文字列に置換する
//c_str()変換
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数:reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド 引数:サイズ、値
//与えられたサイズと値でvectorを初期化する

//queueクラス
//find()次に取り出す値の表示をする。
//pop()値を取り出す。戻り値はなし
//push()キューに値をプッシュする

//priority_queueクラス

//切り上げ
//ceil
//floor

bool check(llong A, llong B, llong C, llong N){
    llong total = 0;


    total = (N/A)*B + (N-N/A);
    if(total<C){
        return true;
    }
    return false;
}

int main(){
    llong A,B,C;
    cin >> A >> B >> C;
    

    llong N=1000000000000000000;  
    llong right, left;
    llong mid;
    right = N+1;
    left  = 1;

    while((right-left)>1){
        mid = (right+left)/2;
        if(check(A,B,C,mid)){
            left = mid;
        }else{
            right = mid;
        }
    }
    cout << right << endl;
    return 0;
}
0