結果
| 問題 | No.276 連続する整数の和(1) |
| コンテスト | |
| ユーザー |
kahuu
|
| 提出日時 | 2016-04-03 00:38:15 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 301 bytes |
| 記録 | |
| コンパイル時間 | 1,197 ms |
| コンパイル使用メモリ | 173,060 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-18 21:58:38 |
| 合計ジャッジ時間 | 3,942 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 2 TLE * 1 |
ソースコード
#include <bits/stdc++.h>
#define LL long long
LL sum(LL x);
int main(void) {
LL n; scanf("%lld", &n);
for (LL i = n; i >= 1; i--) {
if ((sum(n) * (n / i) + sum(n % i)) % i == 0) {
printf("%lld\n", i);
break;
}
}
return 0;
}
LL sum(LL x) {
return (1 + x) * x / 2;
}
kahuu