QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#584622 | #7809. 小苹果 | MrPython | 100 ✓ | 0ms | 3704kb | C++14 | 478b | 2024-09-23 15:52:26 | 2024-09-23 15:52:27 |
Judging History
answer
#include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
istream& fin = cin;
ostream& fout = cout;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
int main(void) {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
ui x;
fin >> x;
size_t i = 0, j = ~0;
while (x) {
if (x % 3 == 1 && !~j) j = i;
x -= (x + 2) / 3;
++i;
}
fout << i << ' ' << j + 1;
return 0;
}
详细
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 0ms
memory: 3704kb
input:
5
output:
4 4
result:
ok single line: '4 4'
Test #2:
score: 10
Accepted
time: 0ms
memory: 3560kb
input:
8
output:
5 5
result:
ok single line: '5 5'
Test #3:
score: 10
Accepted
time: 0ms
memory: 3688kb
input:
713
output:
16 2
result:
ok single line: '16 2'
Test #4:
score: 10
Accepted
time: 0ms
memory: 3704kb
input:
799
output:
16 1
result:
ok single line: '16 1'
Test #5:
score: 10
Accepted
time: 0ms
memory: 3560kb
input:
747
output:
16 8
result:
ok single line: '16 8'
Test #6:
score: 10
Accepted
time: 0ms
memory: 3576kb
input:
779161
output:
33 1
result:
ok single line: '33 1'
Test #7:
score: 10
Accepted
time: 0ms
memory: 3560kb
input:
576262
output:
32 1
result:
ok single line: '32 1'
Test #8:
score: 10
Accepted
time: 0ms
memory: 3636kb
input:
782951
output:
33 4
result:
ok single line: '33 4'
Test #9:
score: 10
Accepted
time: 0ms
memory: 3608kb
input:
551877
output:
32 2
result:
ok single line: '32 2'
Test #10:
score: 10
Accepted
time: 0ms
memory: 3556kb
input:
926023422
output:
50 4
result:
ok single line: '50 4'