結果
問題 | No.276 連続する整数の和(1) |
ユーザー |
![]() |
提出日時 | 2017-10-14 17:40:18 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 583 ms |
コンパイル使用メモリ | 77,648 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 14:44:00 |
合計ジャッジ時間 | 1,234 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <cstring>#include <math.h>#include <cmath>#include <limits.h>#include <map>#include <set>#include <queue>#include <algorithm>#include <functional>#include <stdio.h>using namespace std;long long MOD = 1000000007;long long gcd( long long a, long long b ) {if ( b == 0 ) { return a; }return gcd( b, a%b );}int main() {long long N;cin >> N;cout << gcd( N, (N*(N-1)/2) ) << endl;return 0;}