UVa10079 Posted on 2026-03-05 Edited on 2026-03-08 In 解題紀錄 , UVa Views: 題目:https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1020 12345678910111213141516171819#include <bits/stdc++.h>using namespace std;using ll = long long;ll table[210000005] = {};int main(){ table[0] = 1; for(int i=1; i<210000001; ++i){ table[i] = table[i-1] + i; } int num; while(cin >> num){ if(num < 0) break; cout << table[num] << '\n'; } return 0;}