목록Problem Solving (49)
프로그래밍 공부
#include #include #include using namespace std; int arr[101][101]; int max_row(){ int max = 0; for(int i = 0; i
#include using namespace std; int main(){ for(int t = 0; t > dump; for(int i = 0; i > arr[i]; for(int i = 0; i
#include using namespace std; int arr[1010]; int check[] = { -2, -1, 1, 2 }; int main(){ for(int t = 0; t > n; for(int i = 2; i > arr[i]; } for(int i = 2; i max) max = arr[i + check[j]]; } } if(cnt == 4){ sum += arr[i] - max; } } cout
#include #include #include using namespace std; string match[11] = { "0001101", "0011001", "0010011", "0111101", "0100011", "0110001", "0101111", "0111011", "0110111", "0001011" }; int main() { int t; cin >> t; for (int i = 0; i > n >> m; for (int j = 0; j > str; if (str.find('1') == -1) continue; tmp = str.substr(str.rfind('1') - 55, 56); } for (int j = 1; j
코드 #include #include using namespace std; int main(){ int n; cin >> n; for(int i = 0; i > a >> b >> c; if (b - a == c - b) ans = 0; else ans = abs(((c - b) - (b - a)) / 2); cout
https://www.acmicpc.net/problem/22352 22352번: 항체 인식 첫 번째 줄에는 SP 촬영 결과의 크기를 의미하는 두 정수 $N$과 $M$이 주어진다. ($1 \le N, M \le 30$) 이는 촬영 결과가 세로로 $N$칸, 가로로 $M$칸 크기의 격자라는 것을 의미한다. 다음 $N$개의 줄에는 www.acmicpc.net 언어 : C++17 환경 : VSCode gcc 8.1.0 아이디어 BFS를 활용하여 해결할 수 있을 거 같아서 BFS를 사용해서 해결했다 처음에는 모든 점에 대해서 BFS를 할까 생각했으나 잘 생각해보니 서로 다른 값을 가진 한 개의 인덱스에서 BFS를 돌린 후 배열이 같지 않다면 백신일 가능성이 없으니 서로 다른 값을 가진 한 개의 인덱스에 대해서만 ..