70 pts!! 大佬求助
查看原帖
70 pts!! 大佬求助
755503
LiJinLin_AFO楼主2022/11/9 16:31
#include<cstdio>
int main(){
    long long x,n;
    scanf("%lld%lld",&x,&n);
    if(!n){
        printf("%lld",x);
        return 0;
    }
    x++,n--;
    if(x%3==0) x/=3;
    while(n){
        int u=x%3?x%3:3;
        if(n<3-u){
            printf("%lld",x+n);
            return 0;
        }
        n-=3-u;
        x=x/3+1;
        if(x==1){
			printf("1");
			return 0;
		}
    }
    printf("%lld",x);
    return 0;
}

6,7,9三个点WA了,神犇们,请问错在哪儿了?

2022/11/9 16:31
加载中...