QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#451545 | #7809. 小苹果 | neilliu# | 100 ✓ | 0ms | 3952kb | C++14 | 565b | 2024-06-23 16:51:14 | 2024-06-23 16:51:14 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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 '