본문 바로가기

USACO/Bronze

(56)
백준 5959 Crop Circles (USACO January 2011 Bronze 4번) 문제 링크: https://www.acmicpc.net/problem/5959 5959번: Crop Circles Bessie and her fellow herd-mates have become extremely territorial. The N (1 > r[i]; for(int i = 0; i
백준 5958 Space Exploration (USACO January 2011 Bronze 3번) 문제 링크: https://www.acmicpc.net/problem/5958 5958번: Space Exploration Farmer John's cows have finally blasted off from earth and are now floating around space in their Moocraft. The cows want to reach their fiery kin on Jupiter's moon of Io, but to do this they must first navigate through the dangerous asteroid belt. Bessie www.acmicpc.net DFS component의 갯수를 세면 됨. 1 2 3 4 5 6 7 8 9 10 11 12 13 14..
백준 5957 Cleaning the Dishes (USACO January 2011 Bronze 2번) 문제 링크: https://www.acmicpc.net/problem/5957 5957번: Cleaning the Dishes Bessie and Canmuu are teaming up to wash the massive pile of N (1 n; for(int i = n; i >= 1; i--) a.push(i); while(c.size() != n) { int u, v; cin >> u >> v; if(u == 1) { while(v--) { b.push(a.top()); a.pop(); } } else { while(v--) { c.push(b.top()); b.pop(); } } } while(!c.empty()) { cout
백준 5956 Symmetry (USACO January 2011 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/5956 5956번: Symmetry Farmer John loves symmetry and is currently arranging his cows on his field partitioned into an N x M (1 m; int ans = 0, r = 1; while(n % 2 == 1 && m % 2 == 1) { ans += r; n /= 2; m /= 2; r *= 4; } cout
백준 5949 Adding Commas (USACO December 2010 Bronze 3번) 문제 링크: https://www.acmicpc.net/problem/5949 5949번: Adding Commas Bessie is working with large numbers N (1 s; int sz = s.size(); if(sz > 9) { s.insert(1, ","); s.insert(5, ","); s.insert(9, ","); } else if(sz > 6) { s.insert(sz - 6, ","); s.insert(sz - 2, ","); } else if(sz > 3) { s.insert(sz - 3, ","); } cout Colored by Color Scripter
백준 5948 Bad Random Numbers (USACO December 2010 Bronze 2번) 문제 링크: https://www.acmicpc.net/problem/5948 5948번: Bad Random Numbers Bessie is trying to generate random numbers. She stumbled upon an old reference to the 'middle square' method for making numbers that appear to be random. It works like this: Pick a starting four digit number (1 n; while(!v[n]) { v[n] = 1; n = n / 100 % 10 * 10 + n / 10 % 10; n *= n; ans++; } cout
백준 5947 Book Club (USACO December 2010 Bronze 1번) 문제 링크: https://www.acmicpc.net/problem/5947 5947번: Book Club Bessie is looking for cows to join her book club. While the herd has N (2 n >> q >> p; for(int i = 1; i a[i][j]; for(int i = 0; i > qj >> aj; for(int j = 1; j
백준 5940 Math Practice (USACO November 2010 Bronze 3번) 문제 링크: https://www.acmicpc.net/problem/5940 5940번: Math Practice One lovely afternoon, Bessie's friend Heidi was helping Bessie review for her upcoming math exam. Heidi presents two integers A (0 B; for(int i = A + 1; i 9) n /= 10; if(n == B) { cout