'알고리즘 모음집' 카테고리의 글 목록 (16 Page)
본문 바로가기
728x90
반응형

알고리즘 모음집307

2021.11.05_1225암호생성기 소스코드 #include #include #include using namespace std; int password[8]; int startIdx, endIdx; void init(); void searchPassword(); int main(int argc, char** argv) { int test_case; int T; ; /* 여러 개의 테스트 케이스가 주어지므로, 각각을 처리합니다. */ for (test_case = 1; test_case > T; init(); searchPassword(); printf("#%d ", test_case); int idx = startIdx; while(1){ printf("%d ", password[idx++]); idx = idx % 8; if (idx .. 2021. 11. 8.
2021.10.31_1226-미로1,1227-미로2 소스코드 #include #include #include #include using namespace std; #define SIZE 16 //미로1 //#define SIZE 100//미로2 char board[SIZE][SIZE]; int visit[SIZE][SIZE]; int dy[] = { -1,0,1,0 }; int dx[] = { 0,1,0,-1 }; int answer; void initData();//초기화 및 초기입력 void miroSearch();//미로 탐색 struct Data { int y, x; }s,e; int main() { int test_case; int T; for (test_case = 1; test_case > T; initData(); miroSearch(); .. 2021. 10. 31.
2021.10.30_1220-Magnetic 소스코드 #include #include #include #include using namespace std; #define SIZE 100 struct Data { int y, x; }; int answer; int board[SIZE][SIZE]; vectormagnetic; void initData();//초기화 및 초기 입력 void moveMagnetic();//마그네틱 이동 int main() { int test_case; int T; for (test_case = 1; test_case =SIZE) { board[i][j] = 0; continue; } if (board[i+1][j] == 0) { board[i][j] = 0; board[i+1][j] = 1; i++; flag = 1; }.. 2021. 10. 30.
2021.10.29_8658-Summation 스 코드 #include #include #include using namespace std; int maxNum, minNum; void initData(); int main(int argc, char** argv) { int test_case; int T; scanf("%d", &T); for (test_case = 1; test_case > firstNumber; int sumNumber = 0; for (int i = 0; i maxNum)maxNum = sumNumber; if (sumNumber < minNum)minNum = sumNumber; }.. 2021. 10. 29.
728x90
반응형