結果
問題 |
No.276 連続する整数の和(1)
|
ユーザー |
![]() |
提出日時 | 2016-04-03 01:22:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 327 bytes |
コンパイル時間 | 1,210 ms |
コンパイル使用メモリ | 157,004 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-02 12:32:31 |
合計ジャッジ時間 | 1,705 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | LL n; scanf("%lld", &n); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> #define LL long long LL sum(LL x); int main(void) { LL n; scanf("%lld", &n); for (LL i = 1; i <= n / 2; i++) { if (n % i == 0 and (sum(n / i - 1) * i) % (n / i) == 0) { printf("%lld\n", n / i); break; } } return 0; } LL sum(LL x) { return ((0 + x) * (x + 1)) / 2; }