QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#287357#7809. 小苹果Haoyue_06432#100 ✓0ms3920kbC++14269b2023-12-20 13:33:412023-12-20 13:33:42

Judging History

This is the latest submission verdict.

  • [2023-12-20 13:33:42]
  • Judged
  • Verdict: 100
  • Time: 0ms
  • Memory: 3920kb
  • [2023-12-20 13:33:41]
  • Submitted

answer

#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e18
using namespace std;
ll n,ans,t;
int main()
{
	scanf("%lld",&n);
	while(n)
	{
		ans++;
		if(!t&&n%3==1)t=ans;
		n-=(n-1)/3+1;
	}
	printf("%lld %lld",ans,t);
	return 0;
}

詳細信息

Test #1:

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

input:

5

output:

4 4

result:

ok single line: '4 4'

Test #2:

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

input:

8

output:

5 5

result:

ok single line: '5 5'

Test #3:

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

input:

713

output:

16 2

result:

ok single line: '16 2'

Test #4:

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

input:

799

output:

16 1

result:

ok single line: '16 1'

Test #5:

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

input:

747

output:

16 8

result:

ok single line: '16 8'

Test #6:

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

input:

779161

output:

33 1

result:

ok single line: '33 1'

Test #7:

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

input:

576262

output:

32 1

result:

ok single line: '32 1'

Test #8:

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

input:

782951

output:

33 4

result:

ok single line: '33 4'

Test #9:

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

input:

551877

output:

32 2

result:

ok single line: '32 2'

Test #10:

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

input:

926023422

output:

50 4

result:

ok single line: '50 4'