結果

問題 No.71 そろばん
ユーザー holegumaholeguma
提出日時 2015-08-12 03:33:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 394 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 71,684 KB
実行使用メモリ 49,652 KB
最終ジャッジ日時 2023-09-25 08:21:11
合計ジャッジ時間 4,039 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,484 KB
testcase_01 AC 46 ms
49,184 KB
testcase_02 AC 46 ms
49,388 KB
testcase_03 AC 45 ms
49,652 KB
testcase_04 AC 45 ms
49,248 KB
testcase_05 AC 44 ms
49,324 KB
testcase_06 AC 46 ms
49,232 KB
testcase_07 AC 46 ms
49,356 KB
testcase_08 AC 46 ms
49,296 KB
testcase_09 AC 45 ms
49,368 KB
testcase_10 AC 46 ms
49,240 KB
testcase_11 AC 45 ms
49,220 KB
testcase_12 AC 44 ms
49,488 KB
testcase_13 AC 45 ms
49,188 KB
testcase_14 AC 46 ms
49,432 KB
testcase_15 AC 46 ms
49,248 KB
testcase_16 AC 45 ms
49,428 KB
testcase_17 AC 46 ms
49,200 KB
testcase_18 AC 45 ms
49,468 KB
testcase_19 AC 46 ms
49,328 KB
testcase_20 AC 45 ms
49,408 KB
testcase_21 AC 45 ms
49,328 KB
testcase_22 AC 44 ms
49,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
long n=Long.parseLong(line);
long k=(long)n/2;
long ans=-k*k+n*k+n;
out.println(ans);
out.flush();
}
}
}
0