1 条题解
-
1
#include <bits/stdc++.h> using namespace std; void solve() { int n, c = 1, cnt = 0; cin >> n; int res = 1; for(int i = 1; i < n; ++ i) { cnt ++; res += c; if(cnt == 2) { cnt = 0; c ++; } } cout << res << '\n'; } signed main() { int t = 1; cin >> t; while (t --) solve(); return 0; }
- 1
信息
- ID
- 5567
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 10
- 标签
- 递交数
- 1
- 已通过
- 1
- 上传者