QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#451545#7809. 小苹果neilliu#100 ✓0ms3952kbC++14565b2024-06-23 16:51:142024-06-23 16:51:14

Judging History

This is the latest submission verdict.

  • [2024-06-23 16:51:14]
  • Judged
  • Verdict: 100
  • Time: 0ms
  • Memory: 3952kb
  • [2024-06-23 16:51:14]
  • Submitted

answer

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    //freopen("apple.in","r",stdin);
    //freopen("apple.out","w",stdout);
    int n; scanf("%d",&n);
    int dayans = 0;
    int tmp = n;
    while(tmp){
        tmp = tmp - (int)ceil((double)tmp / 3.0);
        dayans++;
    }
    printf("%d ",dayans);
    dayans = 1;
    while(n){
        if(n % 3 == 1){
            printf("%d ",dayans);
            return 0;
        }
        n = n - (int)ceil((double)n / 3.0);
        dayans++;
    }
    return 0;
}

詳細信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 3760kb

input:

5

output:

4 4 

result:

ok single line: '4 4 '

Test #2:

score: 10
Accepted
time: 0ms
memory: 3944kb

input:

8

output:

5 5 

result:

ok single line: '5 5 '

Test #3:

score: 10
Accepted
time: 0ms
memory: 3880kb

input:

713

output:

16 2 

result:

ok single line: '16 2 '

Test #4:

score: 10
Accepted
time: 0ms
memory: 3892kb

input:

799

output:

16 1 

result:

ok single line: '16 1 '

Test #5:

score: 10
Accepted
time: 0ms
memory: 3824kb

input:

747

output:

16 8 

result:

ok single line: '16 8 '

Test #6:

score: 10
Accepted
time: 0ms
memory: 3952kb

input:

779161

output:

33 1 

result:

ok single line: '33 1 '

Test #7:

score: 10
Accepted
time: 0ms
memory: 3760kb

input:

576262

output:

32 1 

result:

ok single line: '32 1 '

Test #8:

score: 10
Accepted
time: 0ms
memory: 3888kb

input:

782951

output:

33 4 

result:

ok single line: '33 4 '

Test #9:

score: 10
Accepted
time: 0ms
memory: 3880kb

input:

551877

output:

32 2 

result:

ok single line: '32 2 '

Test #10:

score: 10
Accepted
time: 0ms
memory: 3888kb

input:

926023422

output:

50 4 

result:

ok single line: '50 4 '