2 条题解

  • 2
    @ 2026-7-7 16:34:37
    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	int n;
    	cin >> n;
    	long long ans = 0;
    	long long f = 1;
    	for (int i = 1; i <= n; i++) {
    		f *= i;
    		ans += f;
    	}
    	cout << ans << endl;
    	return 0;
    }
    
    
    • -2
      @ 2026-6-9 17:06:04

      #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 0; long long f = 1; for (int i = 1; i <= n; i++) { f *= i; ans += f; } cout << ans << endl; return 0; }

      • 1

      信息

      ID
      30968
      时间
      1000ms
      内存
      256MiB
      难度
      3
      标签
      (无)
      递交数
      30
      已通过
      20
      上传者