結果
問題 |
No.278 連続する整数の和(2)
|
ユーザー |
![]() |
提出日時 | 2015-09-04 23:10:03 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 634 bytes |
コンパイル時間 | 3,439 ms |
コンパイル使用メモリ | 77,184 KB |
実行使用メモリ | 41,500 KB |
最終ジャッジ日時 | 2024-07-19 01:42:48 |
合計ジャッジ時間 | 6,436 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 15 |
ソースコード
import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class No0278 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { long n = in.nextLong(); out.println(n%2 == 0 ? (n/2+(n/2 == 1 ? 0 : 1)) : (n+1)); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); out.close(); } static void trace(Object... o) { System.out.println(Arrays.deepToString(o));} }