algospot 3

[ALGOSPOT] 알고스팟: Longest Increasing Sequence

https://www.algospot.com/judge/problem/read/LIS algospot.com :: LIS Longest Increasing Sequence 문제 정보 문제 어떤 정수 수열에서 0개 이상의 숫자를 지우면 이 수열의 부분 수열 (subsequence) 를 얻을 수 있다. 예를 들어 10 7 4 9 의 부분 수열에는 7 4 9, 10 4, 10 9 등이 있다. www.algospot.com #include using namespace std; int C, N, subseq[501], mx; int dp[501]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> C; while(C--){ memset(dp, 0, sizeof(d..

[ALGOSPOT] 알고스팟: 외발 뛰기

https://www.algospot.com/judge/problem/read/JUMPGAME algospot.com :: JUMPGAME 외발 뛰기 문제 정보 문제 땅따먹기를 하다 질린 재하와 영훈이는 땅따먹기의 변종인 새로운 게임을 하기로 했습니다. 이 게임은 그림과 같이 n*n 크기의 격자에 각 1부터 9 사이의 정수를 쓴 상 www.algospot.com [BOJ] 1890번: 점프 와 유사한 문제입니다. #include using namespace std; int C, N, board[101][101], jumpDist; bool dp[101][101]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> C; while(C--){ memset(d..

[ALGOSPOT] 알고스팟: 삼각형 위의 최대 경로

https://www.algospot.com/judge/problem/read/TRIANGLEPATH algospot.com :: TRIANGLEPATH 삼각형 위의 최대 경로 문제 정보 문제 6 1 2 3 7 4 9 4 1 7 2 7 5 9 4 위 형태와 같이 삼각형 모양으로 배치된 자연수들이 있습니다. 맨 위의 숫자에서 시작해, 한 번에 한 칸씩 아래로 내려가 맨 아래 www.algospot.com #include using namespace std; int C, n, tri[101][101], dp[101][101]; int solve(){ // dp[i][j] : (i,j)까지의 최대합 // dp[i][j] = max(dp[i-1][j], dp[i-1][j-1]) + tri[i][j]; for(i..