2 solutions

  • 0
    @ 2024-6-30 10:55:29
    include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	int days=0,date=0;
    	while(n)
    	{
    		days++;
    		if(!date&&n%3==1) date=days;
    		n-=(n+2)/3; //减去拿走的苹果数目 
    	}
    	cout<<days<<" "<<date;
    	return 0;
    }👍 
    

    Information

    ID
    1262
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    16
    Accepted
    5
    Uploaded By