QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#202976#4653. Painting Gameyiyiyi#AC ✓13ms3792kbC++17554b2023-10-06 14:25:082023-10-06 14:25:09

Judging History

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

  • [2023-10-06 14:25:09]
  • 评测
  • 测评结果:AC
  • 用时:13ms
  • 内存:3792kb
  • [2023-10-06 14:25:08]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define rev_rep(i,s,t) for(int i=(s);i>=(t);i--)
using namespace std;
int ci(){
	int x; scanf("%d",&x); return x;
}

enum{N=200023};

signed main(){
	int T = ci();
	while( T-- ){
		int n = ci();
		char s[10];
		scanf("%s", s);
		int bk = 0;
		if( s[0]=='A' ){
			if( n<=3 ){
				puts("1");
				continue;
			}
			bk+=1;
			n-=3;
		}
		int t = n/7;
		const int a[] = {0,1,1,2,2,3,3};
		printf("%d\n",t*3+a[n-t*7]+bk);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 13ms
memory: 3792kb

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