mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 15:18:46 +00:00
A - 排球
This commit is contained in:
parent
4744b466d1
commit
c120cb7353
30
XJOI/contest/22a/A/A.cpp
Normal file
30
XJOI/contest/22a/A/A.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
int op, x, a, b, aa, bb;
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
|
||||
while (cin >> op >> x) {
|
||||
(op == 1 ? a : b) += x;
|
||||
|
||||
if (std::abs(a - b) >= 2 && (a >= 25 || b >= 25)) {
|
||||
cout << a << ':' << b << endl;
|
||||
if (a > b)
|
||||
aa++;
|
||||
else
|
||||
bb++;
|
||||
a = 0, b = 0;
|
||||
}
|
||||
|
||||
if (aa + bb >= 3) break;
|
||||
}
|
||||
|
||||
cout << (aa < bb) + 1 << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user