QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#839123 | #7809. 小苹果 | luohanzhang | 100 ✓ | 0ms | 3876kb | C++14 | 233b | 2025-01-01 11:57:12 | 2025-01-01 11:57:13 |
Judging History
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;
}
詳細信息
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'