結果
| 問題 |
No.115 遠足のおやつ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-18 19:23:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,446 bytes |
| コンパイル時間 | 729 ms |
| コンパイル使用メモリ | 93,512 KB |
| 実行使用メモリ | 7,880 KB |
| 最終ジャッジ日時 | 2024-10-01 20:22:05 |
| 合計ジャッジ時間 | 2,315 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 14 WA * 26 |
ソースコード
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
using namespace std;
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
int N,D,K;
int dp[101][1001][11];
vector<int>now;
vector<int>ans;
int solve(int a,int b,int c){ //n,d,k
if(dp[a][b][c]!=-1)return dp[a][b][c];
if(c==K){
if(b==D){
if(ans.size()==0)
ans=now;
return 1;
}
else{
return 0;
}
}
if(a==N)
return 0;
int ret=0;
now.push_back(a+1);
int use=solve(a+1,b+(a+1),c+1);
now.pop_back();
int not_use=solve(a+1,b,c);
ret=(use||not_use);
return dp[a][b][c]=ret;
}
int main(){
cin>>N>>D>>K;
fill((int*)dp,(int*)dp+101*1001*11,-1);
if(solve(0,0,0)){
cout<<"AAA"<<endl;
for(int i=0;i<ans.size();i++)
cout<<ans[i];
cout<<endl;
}
else
cout<<"-1"<<endl;
return 0;
}