fork download
  1. #include <cstdio>
  2. #include <vector>
  3. #include <iostream>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. void max_path(vector<vector<int> > pyramid, int n) {
  9. int solution = 1;
  10. string res = "";
  11. for (int i=1; i<n; i++) res += 'R';
  12. cout << solution << endl << res << endl;
  13. }
  14.  
  15. int main() {
  16. long long int n;
  17. cin >> n;
  18. vector<vector<int> > pyramid(n,vector<int>(n,0));
  19. for (int i=0; i<n; i++) {
  20. for(int j=0; j<=i; j++) {
  21. cin >> pyramid[i][j];
  22. }
  23. }
  24. max_path(pyramid,n);
  25. }
Success #stdin #stdout 0s 3436KB
stdin
5
7
3 8
8 1 0
2 7 4 4
4 5 2 6 5
stdout
1
RRRR