UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#204232#3584. LydiaMinas1001ms1232kbC++347b2024-05-04 09:03:552024-05-04 12:49:41

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,dp[70][70];
signed main(){
	cin>>n;
	n++;
	dp[1][1]=1;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=i;j++){
			dp[i][j]=dp[i-1][j-1]+dp[i-1][j];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=i;j++){
			cout<<dp[i][j]<<" ";
		}
		cout<<endl;
	}
	return 0;
}

Details

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

3

output:

1 
1 1 
1 2 1 
1 3 3 1 

result:

ok 4 lines

Test #2:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

4

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 

result:

ok 5 lines

Test #3:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

5

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 

result:

ok 6 lines

Test #4:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

10

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 11 lines

Test #5:

score: 10
Accepted
time: 0ms
memory: 1208kb

input:

20

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 21 lines

Test #6:

score: 10
Accepted
time: 0ms
memory: 1216kb

input:

30

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 31 lines

Test #7:

score: 10
Accepted
time: 0ms
memory: 1220kb

input:

40

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 41 lines

Test #8:

score: 10
Accepted
time: 1ms
memory: 1224kb

input:

50

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 51 lines

Test #9:

score: 10
Accepted
time: 0ms
memory: 1232kb

input:

60

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 61 lines

Test #10:

score: 10
Accepted
time: 0ms
memory: 1228kb

input:

66

output:

1 
1 1 
1 2 1 
1 3 3 1 
1 4 6 4 1 
1 5 10 10 5 1 
1 6 15 20 15 6 1 
1 7 21 35 35 21 7 1 
1 8 28 56 7...

result:

ok 67 lines