Source Code
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(),x.end()
#define answer(x) cout << (x ? "YES\n" : "NO\n")
#define test ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int T; cin >> T; while(T--)
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define F first
#define S second
using namespace std;

void prnt(ll i)
{
	while(i--) cout << "-"; 
}


void fn(ll i)
{
	if(i == 1) return void(cout << "-\n");
	
	fn(i - 1); 
	prnt(i); cout << '\n'; 
	fn(i - 1);
}

ll n, p; 

int main()
{	
	cin >> n >> p; 
	for(int i=0 ;i <n; i++)
	{	
		prnt(p); 
		cout << i << '\n'; 
		fn(p - 1); 
	}
	prnt(p);
	cout << n;
}



Copy
Ruler MuhammedAlajam
GNU G++17
167 ms
262.1 MB
Memory Limit Exceeded