結果
| 問題 |
No.276 連続する整数の和(1)
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-09-04 23:22:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 212 bytes |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 33,232 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 02:13:03 |
| 合計ジャッジ時間 | 748 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | int n;scanf("%d",&n);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
#include <algorithm>
using namespace std;
//namaega184
int main(){
int n;scanf("%d",&n);
long long a=(long long)n*(n+1)/2,b=n,c;while((c=b%a)!=0){b=a;a=c;}
printf("%lld\n",a);
return 0;
}
184