結果

問題 No.276 連続する整数の和(1)
ユーザー kou6839kou6839
提出日時 2015-09-06 17:23:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 443 bytes
コンパイル時間 2,260 ms
コンパイル使用メモリ 75,768 KB
実行使用メモリ 56,120 KB
最終ジャッジ日時 2023-09-26 09:35:47
合計ジャッジ時間 4,397 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,840 KB
testcase_01 AC 122 ms
55,900 KB
testcase_02 AC 121 ms
54,272 KB
testcase_03 AC 122 ms
55,836 KB
testcase_04 AC 122 ms
56,120 KB
testcase_05 AC 122 ms
55,736 KB
testcase_06 AC 122 ms
55,604 KB
testcase_07 AC 123 ms
55,732 KB
testcase_08 AC 120 ms
55,924 KB
testcase_09 AC 125 ms
56,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.ObjectInputStream.GetField;
import java.net.NetworkInterface;
import java.util.*;
import java.util.zip.Inflater;

import javax.swing.plaf.synth.SynthSpinnerUI;


public class Main {
	static long gcd(long N, long N2){
		if(N2==0) return N;
		else return gcd(N2, N%N2);
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		
		System.out.println(gcd(N,N*(N-1)/2));
	}	
}
0