結果

問題 No.176 2種類の切手
ユーザー ry0u_ydry0u_yd
提出日時 2015-04-03 00:03:55
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 473 bytes
コンパイル時間 580 ms
コンパイル使用メモリ 59,224 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 21:32:25
合計ジャッジ時間 3,434 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int a,b,t;
	cin >> a >> b >> t;

	if(a < b) swap(a,b);

	int d = a-b;
	int res = 0;
	while(res < t)
	{
		if(res + a <= t) res += a;
		else res += b;
	}

	bool flag = true;
	while(flag)
	{
		if(res - d >= t) res -= d;
		else flag = false;
	}

	cout << res << endl;



	return 0;
}
0