結果
| 問題 | No.480 合計 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-17 12:59:55 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 230 bytes |
| 記録 | |
| コンパイル時間 | 661 ms |
| コンパイル使用メモリ | 76,652 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-06 03:29:01 |
| 合計ジャッジ時間 | 1,380 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 22 |
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main()
| ^~~~
main.cpp: In function 'int main()':
main.cpp:15:13: warning: 'sum' may be used uninitialized [-Wmaybe-uninitialized]
15 | sum += i;
| ~~~~^~~~
main.cpp:12:9: note: 'sum' was declared here
12 | int sum;
| ^~~
ソースコード
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
// namespace std
main()
{
int N;
cin >> N;
int sum;
for (int i = 1; i < N; i++)
{
sum += i;
}
cout << sum << endl;
}