QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#100322 | #4653. Painting Game | jcccc# | AC ✓ | 14ms | 3452kb | C++17 | 814b | 2023-04-25 16:35:41 | 2023-04-25 16:35:45 |
Judging History
answer
#include<bits/stdc++.h>
#define x first
#define y second
#define endl '\n'
#define LL long long
#define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const LL N = 2000010, MOD = 1e18;
typedef pair<int, int> PII;
LL n, m1, m2, t = 1;
LL cnt[N];
int main() {
ios;
cin >> t;
while(t--){
string s;
cin >> n >> s;
if(s == "Alice") {
int ans = n / 7 * 3;
int x = n % 7;
if(x == 0) cout << ans << endl;
else if(x <= 3) cout << ans + 1 << endl;
else if(x <= 5) cout << ans + 2 << endl;
else cout << ans + 3 << endl;
}
else {
int ans = n / 7 * 3;
int x = n % 7;
if(x == 0) cout << ans << endl;
else if(x <= 2) cout << ans + 1 << endl;
else if(x <= 4) cout << ans + 2 << endl;
else cout << ans + 3 << endl;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 14ms
memory: 3452kb
input:
100000 202887890 Bob 212404006 Bob 127716000 Alice 334251217 Bob 379690549 Alice 450610130 Alice 946907168 Bob 29213358 Bob 112883509 Bob 794872736 Bob 403671135 Alice 714834265 Bob 540986736 Bob 935406639 Bob 756411692 Bob 182091395 Alice 662716337 Alice 217541941 Alice 190231925 Bob 705864412 Alic...
output:
86951953 91030289 54735429 143250522 162724521 193118627 405817358 12520011 48378647 340659744 173001915 306357543 231851459 400888560 324176440 78039169 284021287 93232261 81527968 302513320 385317310 248910271 89712786 114747698 104329089 318680693 405027784 340745046 158738673 175289439 229444256...
result:
ok 100000 lines