| 20179 | 2026-01-03 21:16:59 | ercseferenc | Díjazás több helyezettnek | cpp17 | Forditási hiba |
#include <bits/stdc++.h>
using namespace std;
int n,m,taxi; vector<int>a;
void megold(int i, int t, int s){
if(i==n-1){a[i]=s;
if(a[i]<=t && a[i]>0){for(int j:a)cout<<<<" "; cout<<endl;}}
else{
while(s-t<(n-i-1)*(n-i)/2){t--;}
for(int k=t; k>=n-i; k--){
a[i]=k;
megold(i+1, k-1, s-k);}}}
int main()
{
cin>>n>>m; a.resize(n);
megold(0, m-n*(n-1)/2, m);
return 0;
}open /var/local/lib/isolate/410/box/a.out: no such file or directory
main.cpp: In function 'void megold(int, int, int)':
main.cpp:6:49: error: expected primary-expression before '<<' token
6 | if(a[i]<=t && a[i]>0){for(int j:a)cout<<<<" "; cout<<endl;}}
| ^~