행/열에 대한 합을 저장하는 (col, row) 배열과. 증가대각선,감소대각선에 대한 합을 저장하는 변수(Adddiagonal/Minusdiagonal)를 미리 선언했습니다. - 2중 for문을 통해 수를 입력받으면서 해당 행/열의 합, 대각선의 합에 값을 더해줍니다. - 입력이 끝난 후 배열과 변수에 저장된 값 중 가장 큰 값이 답이 됩니다. C++ 소스 코드 #include #include using namespace std; int col[100],row[100],Adddiagonal,Minusdiagonal; int main(){ int t,num; for(int tc = 1;tc> t; for(int i=0;i num; col[j]+=num; row[i]+=num; if (i==j) { Addd..
입력받은 2차원 배열 전체를 돌면서, 모든 (i,j) 쌍에서 가능한 회문의 최대 길이를 구하면 그 중 최대값이 답이 됩니다. C++ 소스 코드 #include #include #define MAX 100 using namespace std; string map[MAX]; int check(int x, int y){ for(int k=MAX;k>=2;k--){ int width = k,height = k; for(int t = 0;t 1) return height; } return 1; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tc; for(int test_case = 1; test_case> tc; int ans =..
- Total
- Today
- Yesterday
- blendshape
- 안드로이드
- 백준
- GraphDB
- ios
- Reactivex
- 코코아팟
- rxswift
- ARKit
- Kotlin
- coreml
- SwiftUI
- infallible
- 카카오인턴십
- Swift weak
- cocoapods
- Lottie
- UIHostingController
- SWEA
- 프로그래머스
- 백준온라인저지
- boj
- disposeBag
- Swift
- rxswift6
- DispatchQueue
- blendshapes
- C++
- 알고리즘
- Swift unowned
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |