Solutions/Dlbo's Solution PKU 1804. 뇌인간(?) get AC~ 알 수 없는 사용자 2008. 10. 9. 00:04 #include <iostream> #include <algorithm> using namespace std; int main() { int x, y, i, j, n, data, buf[1000], cnt; cin >> n; for (x = 1; x <= n; x++) { cin >> data; cnt = 0; for (y = 0; y < data; y++) { cin >> buf[y]; } for (i = data - 2; i >= 0; i--) { for (j = 0; j <= i; j++) { if (buf[j] > buf[j + 1]) { cnt++; swap(buf[j], buf[j + 1]); } } } cout << "Scenario #" << x << ":" << endl; cout << cnt << endl << endl; } }끙끙. 단순한 버블소트.-_-