baekjoon 20260322
This commit is contained in:
parent
5baec899f6
commit
b2ed898b3b
30
code_study/Baekjoon/c/11053.c
Normal file
30
code_study/Baekjoon/c/11053.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define MAX 1000
|
||||||
|
|
||||||
|
int A[MAX], dp[MAX];
|
||||||
|
int N, ans;
|
||||||
|
|
||||||
|
int max(int a, int b) {
|
||||||
|
return a > b ? a : b;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
scanf("%d", &N);
|
||||||
|
for(int i=0; i<N; i++) {
|
||||||
|
scanf("%d",&A[i]);
|
||||||
|
dp[i] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=1; i<N; i++) {
|
||||||
|
for(int j=0; j<i; j++) {
|
||||||
|
if(A[i] > A[j]) dp[i] = max(dp[i], dp[j] + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<N; i++) ans = max(dp[i], ans);
|
||||||
|
|
||||||
|
printf("%d\n", ans);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
8
code_study/Baekjoon/python/16199.py
Normal file
8
code_study/Baekjoon/python/16199.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
y1, m1, d1 = map(int, input().split())
|
||||||
|
y2, m2, d2 = map(int, input().split())
|
||||||
|
|
||||||
|
age1 = y2 - y1 if m1 < m2 or (m1 == m2 and d1 <= d2) else y2-y1-1
|
||||||
|
age2 = y2-y1+1
|
||||||
|
age3 = y2-y1
|
||||||
|
|
||||||
|
print(age1, age2, age3, sep="\n")
|
||||||
Loading…
x
Reference in New Issue
Block a user