QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#287357 | #7809. 小苹果 | Haoyue_06432# | 100 ✓ | 0ms | 3920kb | C++14 | 269b | 2023-12-20 13:33:41 | 2023-12-20 13:33:42 |
Judging History
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'