Submission #19556402


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[n][n];
	bzero(a, sizeof(a));
	REP(i, n) REP(j, i+1) cin >> a[i][j];
	REP(i, n) REP(j, n) {
		if (i > 0 && j > 0)
			a[i][j] = max(a[i][j] + a[i-1][j], a[i][j] + a[i-1][j-1]);
	}
	int res = 0;
	REP(i, n) res = max(res, a[n-1][i]);
	cout << res << '\n';
	return 0;
}

Submission Info

Submission Time
Task D - 三角パズル
User solareenlo
Language C++ (GCC 9.2.1)
Score 0
Code Size 414 Byte
Status WA
Exec Time 8 ms
Memory 3680 KB

Judge Result

Set Name sub1 sub2
Score / Max Score 0 / 50 0 / 50
Status
AC × 10
WA × 3
AC × 17
WA × 7
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 8 ms 3444 KB
sub1/input_1.txt AC 2 ms 3532 KB
sub1/input_14.txt AC 2 ms 3572 KB
sub1/input_15.txt AC 2 ms 3440 KB
sub1/input_18.txt AC 2 ms 3568 KB
sub1/input_19.txt AC 2 ms 3444 KB
sub1/input_2.txt AC 2 ms 3444 KB
sub1/input_20.txt WA 2 ms 3448 KB
sub1/input_3.txt AC 2 ms 3448 KB
sub1/input_4.txt AC 2 ms 3556 KB
sub1/input_5.txt AC 2 ms 3560 KB
sub1/input_6.txt WA 2 ms 3444 KB
sub1/input_9.txt WA 2 ms 3448 KB
sub2/input_0.txt AC 4 ms 3440 KB
sub2/input_1.txt AC 2 ms 3680 KB
sub2/input_10.txt AC 2 ms 3580 KB
sub2/input_11.txt AC 2 ms 3564 KB
sub2/input_12.txt AC 2 ms 3540 KB
sub2/input_13.txt AC 2 ms 3576 KB
sub2/input_14.txt AC 2 ms 3568 KB
sub2/input_15.txt AC 2 ms 3568 KB
sub2/input_16.txt AC 2 ms 3572 KB
sub2/input_17.txt WA 2 ms 3504 KB
sub2/input_18.txt AC 2 ms 3568 KB
sub2/input_19.txt AC 3 ms 3416 KB
sub2/input_2.txt AC 3 ms 3556 KB
sub2/input_20.txt WA 5 ms 3540 KB
sub2/input_21.txt WA 2 ms 3560 KB
sub2/input_22.txt AC 3 ms 3564 KB
sub2/input_23.txt WA 4 ms 3560 KB
sub2/input_3.txt AC 2 ms 3600 KB
sub2/input_4.txt AC 2 ms 3496 KB
sub2/input_5.txt AC 3 ms 3556 KB
sub2/input_6.txt WA 2 ms 3560 KB
sub2/input_7.txt AC 3 ms 3540 KB
sub2/input_8.txt WA 2 ms 3568 KB
sub2/input_9.txt WA 2 ms 3424 KB