結果

問題 No.276 連続する整数の和(1)
ユーザー hkr
提出日時 2017-02-15 10:11:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 236 bytes
コンパイル時間 589 ms
コンパイル使用メモリ 54,264 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 22:52:56
合計ジャッジ時間 2,533 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    long long n, sum = 0;
    cin >> n;
    for(int i=1;i<n;i++) {
        sum += i;
    }
    if(sum % n == 0)
        cout << n << endl;
    else
        cout << n - 1 << endl;
}
0