QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#839123#7809. 小苹果luohanzhang100 ✓0ms3876kbC++14233b2025-01-01 11:57:122025-01-01 11:57:13

Judging History

This is the latest submission verdict.

  • [2025-01-01 11:57:13]
  • Judged
  • Verdict: 100
  • Time: 0ms
  • Memory: 3876kb
  • [2025-01-01 11:57:12]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int n,ans1,ans2;
int main(){
	scanf("%d",&n);
	while(n!=0){
		ans1++;
		if(ans2==0 && n%3==1){
			ans2=ans1;
		}
		n-=(n-1)/3+1;
	}
	printf("%d %d\n",ans1,ans2);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 0ms
memory: 3736kb

input:

5

output:

4 4

result:

ok single line: '4 4'

Test #2:

score: 10
Accepted
time: 0ms
memory: 3796kb

input:

8

output:

5 5

result:

ok single line: '5 5'

Test #3:

score: 10
Accepted
time: 0ms
memory: 3876kb

input:

713

output:

16 2

result:

ok single line: '16 2'

Test #4:

score: 10
Accepted
time: 0ms
memory: 3748kb

input:

799

output:

16 1

result:

ok single line: '16 1'

Test #5:

score: 10
Accepted
time: 0ms
memory: 3812kb

input:

747

output:

16 8

result:

ok single line: '16 8'

Test #6:

score: 10
Accepted
time: 0ms
memory: 3728kb

input:

779161

output:

33 1

result:

ok single line: '33 1'

Test #7:

score: 10
Accepted
time: 0ms
memory: 3732kb

input:

576262

output:

32 1

result:

ok single line: '32 1'

Test #8:

score: 10
Accepted
time: 0ms
memory: 3816kb

input:

782951

output:

33 4

result:

ok single line: '33 4'

Test #9:

score: 10
Accepted
time: 0ms
memory: 3792kb

input:

551877

output:

32 2

result:

ok single line: '32 2'

Test #10:

score: 10
Accepted
time: 0ms
memory: 3876kb

input:

926023422

output:

50 4

result:

ok single line: '50 4'