Code Submission Evaluation System Login

CSES - HIIT Open 2017

HIIT Open 2017

Contest start:2017-05-27 11:00:00
Contest end:2017-05-27 16:00:00

Task list | Submit code | Submissions | Messages | Scoreboard


History
2017-05-27 11:11:30
Task:Algorithm
Sender:oispa opiskelupaikka tefyllä ;...;
Submission time:2017-05-27 11:11:30
Status:READY
Result:ACCEPTED

Show test data

Code

#include <bits/stdc++.h>

using namespace std;

int main(){
    long long n; cin >> n;

    
    long long z2 = 0;
    long long lis = 0;
    for(long long i = 1; i <= n; ++i){
        lis+=i;
        z2+=lis;
    }
    cout << z2 << endl;
    return 0;
}