結果

問題 No.115 遠足のおやつ
ユーザー tkzw_21tkzw_21
提出日時 2014-12-29 00:04:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 741 bytes
コンパイル時間 824 ms
コンパイル使用メモリ 63,268 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-31 00:20:49
合計ジャッジ時間 2,370 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

//#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <cstring>
#define INF 114514
using namespace std;

typedef pair<double,double> P;
typedef long long ll;

int N,K,D;
vector<int> vi;
bool used[102][1001][11];

void dfs(int d,int n,int k){
	if(k > K || d > D || n-1 > N)return;
	if(used[n][d][k])return;
	used[n][d][k] = true;
	if(k == K && d == D){
		for(int i=0;i<vi.size();i++){
			cout << vi[i];
			if(i == vi.size()-1)cout << endl;
			else cout << " ";
		}
		exit(0);
	}
	vi.push_back(n);
	dfs(d+n,n+1,k+1);
	vi.pop_back();
	dfs(d,n+1,k);
}

int main(void) {
	cin >> N >> D >> K;
	dfs(0,1,0);
	cout << -1 << endl;

}

//command ctrl 上下
//command D
//command caps G → '' ""
0