結果

問題 No.2937 Sigma Plus Problem
ユーザー 大友崚世
提出日時 2024-12-02 15:39:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 131 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 191,272 KB
最終ジャッジ日時 2025-02-26 10:36:27
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:22: warning: ‘n’ is used uninitialized [-Wuninitialized]
    5 |         ans = n * (n + 1LL) / 2LL;
      |                   ~~~^~~~~~
main.cpp:4:19: note: ‘n’ was declared here
    4 |         long long n,ans = 0;
      |                   ^

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main() {
	long long n,ans = 0;
	ans = n * (n + 1LL) / 2LL;
	cout << ans << endl;
}
0