https://atcoder.jp/contests/abc313/tasks/abc313_c C - Approximate Equalization 2 AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp 본 글은 에디토리얼을 해석하고 제 해석대로 간단하게 나타낸 글입니다. 먼저, $A_i$를 주어진 수열, $B_i$를 $A_i$를 조작해서 얻어야 하는 목표 수열이라고 합시다. 먼저, $A=B$가 되는 최소의 조작횟수를 구하는 방법을 살펴봅시다. 위의 식의 값을 $S$라고 합시다. $A_i, A_j$를 조작해서 얻을 수 있는 $S$의..
AtCoder
vector arr; int main() { fastio(); map mp; int N; cin >> N; arr.resize(N); for(int i=0; i> arr[i].first >> arr[i].second; mp[arr[i].first]++; mp[arr[i].second]++; } for(int i=0; i=2 && mp[arr[i].second]>=2 && arr[i].first !=arr [i].second) { cout N; string t="1"; for(int i=2; i=10) { t = t + " " + "1" + char('0'+i%10) + " " + t; } else { t = t + " " + char('0'+i) + " " + t; } } cout > Q; while(Q..