結果
問題 | No.542 1円玉と5円玉 |
ユーザー |
|
提出日時 | 2017-07-14 23:24:45 |
言語 | C++11 (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 829 bytes |
コンパイル時間 | 1,663 ms |
コンパイル使用メモリ | 164,096 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-07 23:33:55 |
合計ジャッジ時間 | 6,655 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 TLE * 1 -- * 5 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i,n) for(int i=0;i<n;i++)#define rrep(i,n) for (int i=n;^i;i--)#define ALL(v) v.begin(),v.end()// #define int ll#define eps 1e-9#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }typedef long long ll;void dfs(int,int,int);set<int> mon;int main(void){int yen1,yen5;cin >> yen1 >> yen5;dfs(yen1,yen5,0);mon.erase(0);for (auto i=mon.begin();i!=mon.end();++i){cout << *i << endl;}return 0;}void dfs(int a,int b,int sum){mon.insert(sum);if (!(a<=0))dfs(a-1,b,sum+1);if (!(b<=0))dfs(a,b-1,sum+5);elsereturn;}