QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#572525#7809. 小苹果zjy0001100 ✓0ms3740kbC++17413b2024-09-18 15:09:272024-09-18 15:09:28

Judging History

This is the latest submission verdict.

  • [2024-09-18 15:09:28]
  • Judged
  • Verdict: 100
  • Time: 0ms
  • Memory: 3740kb
  • [2024-09-18 15:09:27]
  • Submitted

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'