結果
| 問題 |
No.176 2種類の切手
|
| コンテスト | |
| ユーザー |
kyuna
|
| 提出日時 | 2018-11-03 01:34:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 260 bytes |
| コンパイル時間 | 497 ms |
| コンパイル使用メモリ | 23,296 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-20 18:08:07 |
| 合計ジャッジ時間 | 1,390 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d %d", &a, &b, &t);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
int main() {
int a, b, t;
int ans = 2e9;
scanf("%d %d %d", &a, &b, &t);
for (int i = 0; i <= (t + a) / b && i < a; i++) {
int tmp = b * i + (t - b * i + a - 1) / a * a;
if (ans > tmp) ans = tmp;
}
printf("%d", ans);
return 0;
}
kyuna