| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 20848 | 孙喻桐 | 印度国王的棋盘 | C++ | Wrong Answer | 0 | 0 MS | 256 KB | 378 | 2021-06-20 16:26:54 |
#include<bits/stdc++.h> using namespace std; int n,a[100001]; void dfs(int x,int sum,int f){ if(sum>n)return; if(sum==n){ cout<<n<<"="<<a[1]; for(int i=2;i<=x-1;i++){ cout<<"+"<<a[i]; } cout<<endl; return; } for(int i=f;i>=1;i--){ a[x]=i; dfs(x+1,sum+i,i); } } int main(){ cin>>n; cout<<n<<"="<<n<<endl; dfs(1,0,n-1); return 0; }