Submission #19556369


Source Code Expand

Copy
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int main() {
	int n; cin >> n;
	int a[101][101] = {0};
	REP(i, n) REP(j, i+1) cin >> a[i][j];
	for (int i = n-2; i >= 0; i--) REP(j, i+1)
		a[i][j] = max(a[i][j]+a[i+1][j], a[i][j]+a[i+1][j+1]);
	cout << a[0][0] << '\n';
	return 0;
}

Submission Info

Submission Time
Task D - 三角パズル
User solareenlo
Language C++ (GCC 9.2.1)
Score 100
Code Size 340 Byte
Status AC
Exec Time 4 ms
Memory 3660 KB

Judge Result

Set Name sub1 sub2
Score / Max Score 50 / 50 50 / 50
Status
AC × 13
AC × 24
Set Name Test Cases
sub1 sub1/input_0.txt, sub1/input_1.txt, sub1/input_14.txt, sub1/input_15.txt, sub1/input_18.txt, sub1/input_19.txt, sub1/input_2.txt, sub1/input_20.txt, sub1/input_3.txt, sub1/input_4.txt, sub1/input_5.txt, sub1/input_6.txt, sub1/input_9.txt
sub2 sub2/input_0.txt, sub2/input_1.txt, sub2/input_10.txt, sub2/input_11.txt, sub2/input_12.txt, sub2/input_13.txt, sub2/input_14.txt, sub2/input_15.txt, sub2/input_16.txt, sub2/input_17.txt, sub2/input_18.txt, sub2/input_19.txt, sub2/input_2.txt, sub2/input_20.txt, sub2/input_21.txt, sub2/input_22.txt, sub2/input_23.txt, sub2/input_3.txt, sub2/input_4.txt, sub2/input_5.txt, sub2/input_6.txt, sub2/input_7.txt, sub2/input_8.txt, sub2/input_9.txt
Case Name Status Exec Time Memory
sub1/input_0.txt AC 4 ms 3624 KB
sub1/input_1.txt AC 2 ms 3600 KB
sub1/input_14.txt AC 4 ms 3580 KB
sub1/input_15.txt AC 2 ms 3644 KB
sub1/input_18.txt AC 3 ms 3448 KB
sub1/input_19.txt AC 2 ms 3608 KB
sub1/input_2.txt AC 2 ms 3552 KB
sub1/input_20.txt AC 3 ms 3460 KB
sub1/input_3.txt AC 4 ms 3600 KB
sub1/input_4.txt AC 2 ms 3572 KB
sub1/input_5.txt AC 2 ms 3620 KB
sub1/input_6.txt AC 3 ms 3656 KB
sub1/input_9.txt AC 2 ms 3652 KB
sub2/input_0.txt AC 2 ms 3556 KB
sub2/input_1.txt AC 2 ms 3600 KB
sub2/input_10.txt AC 2 ms 3656 KB
sub2/input_11.txt AC 2 ms 3464 KB
sub2/input_12.txt AC 3 ms 3448 KB
sub2/input_13.txt AC 3 ms 3624 KB
sub2/input_14.txt AC 2 ms 3408 KB
sub2/input_15.txt AC 2 ms 3648 KB
sub2/input_16.txt AC 2 ms 3576 KB
sub2/input_17.txt AC 3 ms 3660 KB
sub2/input_18.txt AC 2 ms 3608 KB
sub2/input_19.txt AC 4 ms 3444 KB
sub2/input_2.txt AC 4 ms 3624 KB
sub2/input_20.txt AC 2 ms 3460 KB
sub2/input_21.txt AC 4 ms 3548 KB
sub2/input_22.txt AC 2 ms 3632 KB
sub2/input_23.txt AC 2 ms 3660 KB
sub2/input_3.txt AC 2 ms 3608 KB
sub2/input_4.txt AC 2 ms 3464 KB
sub2/input_5.txt AC 2 ms 3464 KB
sub2/input_6.txt AC 2 ms 3460 KB
sub2/input_7.txt AC 2 ms 3408 KB
sub2/input_8.txt AC 2 ms 3604 KB
sub2/input_9.txt AC 2 ms 3456 KB