2017-01-09から1日間の記事一覧
paiza.jp #include <iostream> using namespace std; void Solve(int n) { int t, s; double x = 0.0, y = 0.0, xx, yy; for (int i=0; i<n; ++i) { cin >> t >> s; if (t == 1) x += s; else if (t == 2) y += s; else { xx = x; yy = y; x -= s*x/(xx+yy); y -= s*y/(xx+yy); } } cou</n;></iostream>…