結果

問題 No.734 Careful Engineer
ユーザー aaaaaa
提出日時 2018-09-28 22:27:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,061 bytes
コンパイル時間 1,061 ms
コンパイル使用メモリ 94,748 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 11:11:21
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>

using namespace std;


int main() {
	int  i, j, k;
	long long a, b, c;

	cin >> a >> b >> c;

	a *= 60;
	c *= 3600;

	if (a <= b) {
		cout << -1 << endl;
		//getchar();
		//getchar();
		return 0;
	}

	long long x;
	long long sa = a - b;


	//x = c / a;



	long long yo = c % a;

	//long long ama = x * b;

	//x = x + (c / sa);
	x =  (c / sa);
	//long long nnn = ((c / sa)*b) / sa;
	//x += nnn;

	//c += (c / sa) * b;
	c += x*b;

	//c += ama;

	while(true){

		//if (c <= a*x) {
		if (c >= a*x) {
			c += b;
			x++;
		}
		else {
			break;
		}

	}

	/*
	long long num = 0;

	while (true) {

		if (yo > b * num) {
			num++;
	
		}
		else {
			break;
		}

	}
	*/

	//cout << x + num << endl;
	cout << x << endl;





	getchar();
	getchar();
	return 0;
}
0