CSES - Putka Open 2020 – 5/5 - Results
Submission details
Task:HQ9+
Sender:Laakeri
Submission time:2020-11-27 18:05:13 +0200
Language:C++ (C++11)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED15
#2ACCEPTED85
Test results
testverdicttimegroup
#1ACCEPTED0.01 s1, 2details
#2ACCEPTED0.01 s2details

Code

#include <bits/stdc++.h>
using namespace std;

void solve(){
	int n;
	cin>>n;
	string ans;
	while (n>=494){
		ans+='9';
		n-=494;
	}
	while (n>=1){
		ans+='Q';
		n--;
	}
	cout<<ans<<endl;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int tcs;
	cin>>tcs;
	for (int t=0;t<tcs;t++){
		solve();
	}
}

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
100
10
96
42
77
...

correct output
HHHHHHHHHH
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

user output
QQQQQQQQQQ
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...
Truncated

Test 2

Group: 2

Verdict: ACCEPTED

input
100
76364
26254
35192
92572
...

correct output
999999999999999999999999999999...

user output
999999999999999999999999999999...
Truncated