QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#572525 | #7809. 小苹果 | zjy0001 | 100 ✓ | 0ms | 3740kb | C++17 | 413b | 2024-09-18 15:09:27 | 2024-09-18 15:09:28 |
Judging History
answer
#include<bits/stdc++.h>
#define LL long long
#define LLL __int128
#define uint unsigned
#define ldb long double
#define uLL unsigned long long
using namespace std;
int n,ans1,ans2;
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin>>n;
while(n){
++ans1;
if(n%3==1&&!ans2)ans2=ans1;
n=n-(n+2)/3;
}
cout<<ans1<<' '<<ans2<<'\n';
return 0;
}
/*
*/
詳細信息
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 0ms
memory: 3668kb
input:
5
output:
4 4
result:
ok single line: '4 4'
Test #2:
score: 10
Accepted
time: 0ms
memory: 3604kb
input:
8
output:
5 5
result:
ok single line: '5 5'
Test #3:
score: 10
Accepted
time: 0ms
memory: 3684kb
input:
713
output:
16 2
result:
ok single line: '16 2'
Test #4:
score: 10
Accepted
time: 0ms
memory: 3740kb
input:
799
output:
16 1
result:
ok single line: '16 1'
Test #5:
score: 10
Accepted
time: 0ms
memory: 3612kb
input:
747
output:
16 8
result:
ok single line: '16 8'
Test #6:
score: 10
Accepted
time: 0ms
memory: 3688kb
input:
779161
output:
33 1
result:
ok single line: '33 1'
Test #7:
score: 10
Accepted
time: 0ms
memory: 3724kb
input:
576262
output:
32 1
result:
ok single line: '32 1'
Test #8:
score: 10
Accepted
time: 0ms
memory: 3608kb
input:
782951
output:
33 4
result:
ok single line: '33 4'
Test #9:
score: 10
Accepted
time: 0ms
memory: 3672kb
input:
551877
output:
32 2
result:
ok single line: '32 2'
Test #10:
score: 10
Accepted
time: 0ms
memory: 3656kb
input:
926023422
output:
50 4
result:
ok single line: '50 4'