1 solutions

  • 0
    @ 2023-11-28 23:31:10

    #include<stdio.h> int main() { int n,i; int a=1,s=1,cnt=0; //cnt表示总金币数 scanf("%d",&n); for(i=0;i<n;i++){ //过于巧妙,我看到后叹为观止 cnt+=a; s--; if(s==0){ //天数达到金币数后,金币重置 a++; s=a; } } printf("%d",cnt); return 0; }

    Information

    ID
    6814
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    # Submissions
    22
    Accepted
    14
    Uploaded By