結果
| 問題 |
No.176 2種類の切手
|
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-10-04 22:33:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 612 bytes |
| コンパイル時間 | 562 ms |
| コンパイル使用メモリ | 61,604 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-11-21 16:55:51 |
| 合計ジャッジ時間 | 9,085 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 TLE * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:30:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
30 | printf("%d\n", ans);
| ~^ ~~~
| | |
| int ll {aka long long int}
| %lld
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
const ll INF = 1e12;
int main(void){
ll a, b, t; cin >> a >> b >> t;
ll ans = INF;
for (int i = 0; i <= 1e9; ++i){//bの数
if(b * i <= t){
int nokori = t - b * i;
int j;
if(nokori % a == 0){
j = nokori / a;
}else{
j = nokori / a + 1;
}
ans = min(ans, (ll)(b * i + a * j));
}else{
//bの数のみで超えるとき
ans = min(ans, (ll)(b * i));
break;
}
}
printf("%d\n", ans);
return 0;
}
srup٩(๑`н´๑)۶