2024/03 22

[Softeer/C++] 진정한 효도

https://softeer.ai/practice/7374 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai 소스코드 #include #include using namespace std; int minmin(int a, int b, int c) { int arr[3] = { a, b, c }; sort(arr, arr + 3); int middle = arr[1]; int result = 0; for (int i = 0; i < 3; i++) { if (arr[i] != middle) result = arr[i] - middle; } return abs(result); } int main(int argc, char** argv) { int in; int arr[3][3]; for (i..

[Softeer/C++]Level2 [한양대 HCPC 2023] X marks the Spot

https://softeer.ai/practice/7703/history?questionType=ALGORITHM Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai 소스코드 #include using namespace std; int main() { int n; cin >> n; string a, b; string result; for (int i = 0; i > a >> b; for (int i = 0; i < a.size(); i++) { a[i] = toupper(a[i]); } size_t idx = a.find("X"); string temp = b.substr(idx, 1); result+= toupper(temp[0]); } cout

[Softeer/C++]Level1 위험한 효도

https://softeer.ai/practice/7368 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai 소스코드 #include #include #include #include #include using namespace std; int main(int argc, char** argv) { int a,b,d; cin >> a>>b>>d; int destint = d * 2; int curdir =0; int time =0; int temp = 0; bool isFront = false; while (destint != curdir) { if (isFront == false) { for (int i = 0; i < a; i++) { time += 1; curdir += 1; if ..

[Softeer/C++]Level1 연탄 배달의 시작

https://softeer.ai/practice/7626 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai 소스코드 #include #include #include #include #include using namespace std; int main(int argc, char** argv) { int a,b; cin >> a; vector list; map m; for (int i = 0; i > b; list.push_back(b); } int temp = list[0]; for (int i = 1; i < list.size(); i++) { int min = list[i] - temp; m[min] += 1; temp = list[i]; } int ..

[Softeer/C++]Level1 [한양대 HCPC 2023] Tren del Fin del Mundo

https://softeer.ai/practice/7695 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai 틀렸는데 피드백좀해주세요 ㅠ 소스코드 #include #include #include #include using namespace std; int main(int argc, char** argv) { int n; cin >> n; cin.ignore(); string maxStr; int max = 0; for (int i = 0; i > a >> b; int result = abs(a - b); if (max < result) { max = result; maxStr = to_string(a)+" "+ to_string(..