結果

問題 No.1461 しあはせや歩みゆく?
ユーザー threepipes_sthreepipes_s
提出日時 2021-04-02 21:26:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 2,243 bytes
コンパイル時間 2,567 ms
コンパイル使用メモリ 77,908 KB
実行使用メモリ 37,148 KB
最終ジャッジ日時 2024-06-06 06:06:13
合計ジャッジ時間 5,612 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
36,728 KB
testcase_01 AC 55 ms
36,972 KB
testcase_02 AC 55 ms
36,876 KB
testcase_03 AC 55 ms
37,148 KB
testcase_04 AC 55 ms
36,596 KB
testcase_05 AC 54 ms
36,920 KB
testcase_06 AC 54 ms
36,728 KB
testcase_07 AC 56 ms
36,976 KB
testcase_08 AC 56 ms
37,144 KB
testcase_09 AC 54 ms
37,068 KB
testcase_10 AC 56 ms
37,144 KB
testcase_11 AC 55 ms
37,072 KB
testcase_12 AC 55 ms
36,916 KB
testcase_13 AC 55 ms
36,704 KB
testcase_14 AC 55 ms
36,992 KB
testcase_15 AC 55 ms
36,676 KB
testcase_16 AC 56 ms
36,992 KB
testcase_17 AC 56 ms
36,972 KB
testcase_18 AC 54 ms
36,976 KB
testcase_19 AC 55 ms
37,100 KB
testcase_20 AC 55 ms
36,904 KB
testcase_21 AC 55 ms
36,728 KB
testcase_22 AC 55 ms
36,972 KB
testcase_23 AC 54 ms
36,992 KB
testcase_24 AC 55 ms
36,976 KB
testcase_25 AC 54 ms
37,052 KB
testcase_26 AC 54 ms
36,884 KB
testcase_27 AC 55 ms
36,704 KB
testcase_28 AC 55 ms
37,116 KB
testcase_29 AC 55 ms
36,964 KB
testcase_30 AC 55 ms
36,976 KB
testcase_31 AC 54 ms
37,000 KB
testcase_32 AC 54 ms
36,704 KB
testcase_33 AC 55 ms
37,144 KB
testcase_34 AC 54 ms
36,704 KB
testcase_35 AC 55 ms
36,972 KB
testcase_36 AC 54 ms
36,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static ContestScanner in;static Writer out;static StringBuilder sb=new StringBuilder();
    public static void main(String[] args)
    {try{in=new ContestScanner();out=new Writer();Main solve=new Main();solve.solve();
        in.close();out.flush();out.close();}catch(IOException e){e.printStackTrace();}}
    void solve() throws NumberFormatException, IOException{
        long n = in.nextLong();
        if (n <= 3) {
            System.out.println(n);
        } else {
            System.out.println(5 * n - 12);
        }
    }
}

class Writer extends PrintWriter{
    public Writer(String filename)throws IOException
    {super(new BufferedWriter(new FileWriter(filename)));}
    public Writer()throws IOException{super(System.out);}
}
class ContestScanner implements Closeable{
    private BufferedReader in;private int c=-2;
    public ContestScanner()throws IOException
    {in=new BufferedReader(new InputStreamReader(System.in));}
    public ContestScanner(String filename)throws IOException
    {in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
    public String nextToken()throws IOException {
        StringBuilder sb=new StringBuilder();
        while((c=in.read())!=-1&&Character.isWhitespace(c));
        while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public String readLine()throws IOException{
        StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
        while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public long nextLong()throws IOException,NumberFormatException
    {return Long.parseLong(nextToken());}
    public int nextInt()throws NumberFormatException,IOException
    {return(int)nextLong();}
    public double nextDouble()throws NumberFormatException,IOException
    {return Double.parseDouble(nextToken());}
    public void close() throws IOException {in.close();}
}
0