7 solutions

  • 0
    @ 2024-12-6 21:48:45
    #include <stdio.h>
    int main()
    {
    	long long n;
    	scanf("%lld", &n);
    	if (n >= 1&&n <= 100000000) 
    	{
    		printf("%lld", ((n+1)*n)/2);
    	}
    	return 0;
    }
    

    Information

    ID
    34
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    2839
    Accepted
    413
    Uploaded By