Submission #73134009


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, a[14][14], c[30][30];

int main() {
	scanf("%d", &n);
	for (int i = 0; i < 30; i++) c[i][0] = 1;
	for (int i = 1; i < 30; i++) {
		for (int j = 1; j <= i; j++) {
			c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
		}
	}
	for (int i = 1; i < n; i++) {
		for (int j = 1; j <= n; j++) {
			a[i + 1][j] = a[i][j + 1] + c[n * 2 - i - j - 2][n - i - 1];
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) printf("%d ", a[i][j]); puts("");
	}
}

Submission Info

Submission Time
Task D - Distinct Sum Grid Path
User Register_int
Language C++23 (GCC 15.2.0)
Score 700
Code Size 551 Byte
Status AC
Exec Time 1 ms
Memory 3896 KiB

Compile Error

./Main.cpp: In function 'int main()':
./Main.cpp:23:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   23 |                 for (int j = 1; j <= n; j++) printf("%d ", a[i][j]); puts("");
      |                 ^~~
./Main.cpp:23:70: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   23 |                 for (int j = 1; j <= n; j++) printf("%d ", a[i][j]); puts("");
      |                                                                      ^~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 700 / 700
Status
AC × 2
AC × 12
Set Name Test Cases
Sample sample-01.txt, sample-02.txt
All 01-03.txt, 01-04.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-03.txt AC 1 ms 3832 KiB
01-04.txt AC 1 ms 3832 KiB
01-06.txt AC 1 ms 3832 KiB
01-07.txt AC 1 ms 3676 KiB
01-08.txt AC 1 ms 3852 KiB
01-09.txt AC 1 ms 3804 KiB
01-10.txt AC 1 ms 3868 KiB
01-11.txt AC 1 ms 3896 KiB
01-12.txt AC 1 ms 3896 KiB
01-13.txt AC 1 ms 3804 KiB
sample-01.txt AC 1 ms 3852 KiB
sample-02.txt AC 1 ms 3832 KiB