QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#584622#7809. 小苹果MrPython100 ✓0ms3704kbC++14478b2024-09-23 15:52:262024-09-23 15:52:27

Judging History

This is the latest submission verdict.

  • [2024-09-23 15:52:27]
  • Judged
  • Verdict: 100
  • Time: 0ms
  • Memory: 3704kb
  • [2024-09-23 15:52:26]
  • Submitted

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'