본문 바로가기
반응형

백준134

[백준/BOJ] 10250번 - ACM 호텔 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int t, h, w, n, a; cin >> t; while (t--) { cin >> h >> w >> n; if (n % h) { a = (n % h) * 100; a += n / h + 1; } else { a = h * 100; a += n / h; } cout 2022. 3. 24.
[백준/BOJ] 10162번 - 전자레인지 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int t, a, b, c; cin >> t; if (t % 10 != 0) { cout 2022. 3. 24.
[백준/BOJ] 9546번 - 3000번 버스 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n, k, ans; cin >> n; while (n--) { cin >> k; ans = 1; for (int i = 1; i < k; i++) ans = ans * 2 + 1; cout 2022. 3. 24.
[백준/BOJ] 9237번 - 이장님 초대 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); vector v; int n, t; cin >> n; for (int i = 0; i > t; v.push_back(t); } sort(v.begin(), v.end(), greater()); for (int i = 0; i < n; i++) v[i] += i + 1; int mx = *max_element(v.begin(), v.end()); cout 2022. 3. 24.
[백준/BOJ] 9095번 - 1, 2, 3 더하기 (C++) 문제 링크 코드 #include using namespace std; int d[20]; int main() { ios::sync_with_stdio(0); cin.tie(0); d[1] = 1; d[2] = 2; d[3] = 4; for (int i = 4; i > t; while (t--) { int n; cin >> n; cout 2022. 3. 24.
[백준/BOJ] 8958번 - OX퀴즈 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); string s; int n, ans, t; cin >> n; while (n--) { t = 1, ans = 0; cin >> s; for (auto c : s) { if (c == 'O') { ans += t; t++; } else t = 1; } cout 2022. 3. 24.
[백준/BOJ] 7568번 - 덩치 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector v(n); vector rank(n, 1); for (int i = 0; i > v[i].first >> v[i].second; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) continue; if (v[i].first < v[j].first && v[i].second < v[j].second) rank[i]++; } } for (auto i : rank) cout 2022. 3. 24.
[백준/BOJ] 6321번 - IBM 빼기 1 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { cout 2022. 3. 24.
[백준/BOJ] 5622번 - 다이얼 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int lt[] = {2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9}; int cnt = 0; string s; cin >> s; for (auto c : s) cnt += lt[c - 'A'] + 1; cout 2022. 3. 24.
[백준/BOJ] 5598번 - 카이사르 암호 (C++) 문제 링크 코드 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; for (char c : s) { char x = c - 3; if (x < 'A') x += 26; cout 2022. 3. 24.
반응형