結果

問題 No.176 2種類の切手
ユーザー kaffelun
提出日時 2017-10-15 19:34:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 1,542 ms
コンパイル使用メモリ 159,032 KB
実行使用メモリ 13,636 KB
最終ジャッジ日時 2024-11-17 17:54:17
合計ジャッジ時間 7,586 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 4 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
	int A, B, T;
	cin >> A >> B >> T;
	int ans = INT_MAX;
	if(A < B) {
		int tmp = A;
		A = B;
		B = tmp;
	}
	for(int i = 0; i <= T; i += A) {
		ans = min(ans, (B - ((T - i) % B)) % B);
	}
	cout << ans + T << endl;
	return 0;
}
0