QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#100322#4653. Painting Gamejcccc#AC ✓14ms3452kbC++17814b2023-04-25 16:35:412023-04-25 16:35:45

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-25 16:35:45]
  • 评测
  • 测评结果:AC
  • 用时:14ms
  • 内存:3452kb
  • [2023-04-25 16:35:41]
  • 提交

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;
		}
	}
}

詳細信息

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