본문 바로가기

반응형

Atcoder

Atcoder Beginner Contest 206 (ABC 206) 풀이 A. Maxi-Buying 단순 계산 문제이다. N을 입력받고, 1.08*N을 정수단위로 올림 했을 때 206과 대소 비교하는 문제이다. #include using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); double n; cin >> n; n *= 1.08; int ans = (int)n; if (ans == 206) cout = n) { cout > n; map mp; for (int i = 0; i > a; mp[a]++; } ll ans = 0; for (auto [a, b] : mp) { ans += 1LL * b * (..
Atcoder Beginner Contest 205 (ABC 205) 풀이 오랜만에 참가한 ABC인데, 마침 오랜만에 ABC 문제들이 괜찮아서 풀이를 작성해보려고 한다. 결과도 나쁘지 않았다. 문제 링크 : https://atcoder.jp/contests/abc205/tasks 공식 해설 : https://atcoder.jp/contests/abc205/editorial (*) = 난이도 A. Kcal (*6) 단순 계산 문제이다. 100ml당 A kcal을 얻을 수 있을 때 Bml이 있으면 몇 kcal를 얻을 수 있는지를 구하면 된다. #include using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); double a, b; cin >> a ..
Atcoder Beginner Contest 185 (ABC 185) 풀이 [문제 링크] atcoder.jp/contests/abc185 AtCoder Beginner Contest 185 - AtCoder AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp [풀이] A. ABC Preparation 각 점수별로 문제 수가 나와있고, 하나의 문제 set을 만들기 위해서는 점수별로 하나씩 문제가 필요하다. 따라서 네 정수 중 최솟값을 출력하면 된다. #include using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(n..