結果
問題 |
No.176 2種類の切手
|
ユーザー |
![]() |
提出日時 | 2015-04-02 23:45:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 503 bytes |
コンパイル時間 | 625 ms |
コンパイル使用メモリ | 71,796 KB |
実行使用メモリ | 688,576 KB |
最終ジャッジ日時 | 2024-10-08 01:37:37 |
合計ジャッジ時間 | 5,168 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | MLE * 1 -- * 28 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) #define INF 1<<30 using namespace std; typedef long long ll; ll a,b,t,ans = INF; map<ll,bool> memo; void dfs(ll x) { if(memo[x]) return; if(x > ans) return; if(x >= t) { ans = min(ans,x); return; } memo[x] = true; dfs(x+a); dfs(x+b); } int main() { cin >> a >> b >> t; dfs(0); cout << ans << endl; return 0; }