結果

問題 No.115 遠足のおやつ
ユーザー d2verbd2verb
提出日時 2015-10-04 15:08:14
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,675 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 95,704 KB
実行使用メモリ 5,256 KB
最終ジャッジ日時 2023-09-27 01:57:04
合計ジャッジ時間 2,807 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 RE -
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
4,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 1 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <numeric>
#include <ctime>
#include <bitset>
#include <cctype>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>

using namespace std;

//define
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF (INT_MAX/2)
#define PI (2*acos(0.0))
#define EPS (1e-8)

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;

int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1};
int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1};

int N, D, K;
int dp[1001][11];

void printResult(){
  vector<int> l;
  int o = D;
  for(int i = K; i >= 1; i--){
    l.push_back(dp[o][i]);
    o -= dp[o][i];
  }
  sort(l.begin(), l.end());
  for(size_t i = 0; i < l.size(); i++){
    if(i) cout << " ";
    cout << l[i];
  }
  cout << endl;
}

void solve(){
  for(int i = 2; i <= D; i++){
    for(int j = 2; j <= K; j++){
      dp[i][j] = dp[i-(j-1)][j-1];
    }
  }
  printResult();
}

int main(void){
  ios_base::sync_with_stdio(0);
  cin >> N >> D >> K;
  for(int i = 1; i <= D; i++) dp[i][1] = i;
  solve();
  return 0; 
}
0