23 条题解

  • 0
    @ 2023-3-13 17:31:11
    #include <stdio.h>
    #include <iostream>
    using namespace std;
    int main()
    {
    	int n;
    	cin >> n;
    	int sum = 0;
    	int num =1,day = 1;
    	for (int i = 1 ; i <= n ; i++)
    	{
    		sum += num;
    		day -= 1;
    		if(day ==0)
    		{
    			num++;
    			day = num;
    		}
    	}
    	cout << sum << endl;
    }
    
    • -1
      @ 2023-3-26 18:14:34
      #include <stdio.h>
      #include <iostream>
      using namespace std;
      int main()
      {
      	int n;
      	cin >> n;
      	int sum = 0;
      	int num =1,day = 1;
      	for (int i = 1 ; i <= n ; i++)
      	{
      		sum += num;
      		day -= 1;
      		if(day ==0)
      		{
      			num++;
      			day = num;
      		}
      	}
      	cout << sum << endl;
      }
      
      • -3
        @ 2022-2-23 21:53:06

        #include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ int temp=1,n,a=0,s=1,w=1; cin>>n; while(1){ a+=temp; if(temps){ temp++; s=0; } if(wn){ cout<<a; return 0; } s++; w++; } }

        信息

        ID
        919
        时间
        1000ms
        内存
        128MiB
        难度
        4
        标签
        递交数
        902
        已通过
        386
        上传者