목록2025/04/02 (2)
정화 코딩

https://www.acmicpc.net/problem/1111 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector arr(n); for (int i = 0; i > arr[i]; set ans; for (int a = -200; a 2) cout 무지성으로 모든 a, b 조합을 체크해서 풀었다...처음에는 a와 b 범위 모두 -100 ~ 100으로 잡았다가 WA를 받았다. 그 후 범위가 부족함을 깨닫고 범위를 늘려줬다. 무지성으로 너무 늘리면 또 시간초과를 ..

https://www.acmicpc.net/problem/25709 #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; int ans = 0; string s = to_string(n); string tmps = ""; for (char c: s) { if (c == '1') ans++; else tmps += c; } if (tmps.empty()) n = 0; else n = stoi(tmps); while (n > 0) { int tmp = n..