結果

問題 No.538 N.G.S.
ユーザー Shun_PIShun_PI
提出日時 2017-06-30 23:00:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,061 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 78,172 KB
実行使用メモリ 52,184 KB
最終ジャッジ日時 2024-04-15 06:54:33
合計ジャッジ時間 6,437 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
49,980 KB
testcase_01 AC 53 ms
49,752 KB
testcase_02 AC 51 ms
50,136 KB
testcase_03 AC 53 ms
49,776 KB
testcase_04 AC 53 ms
50,000 KB
testcase_05 AC 53 ms
50,116 KB
testcase_06 AC 53 ms
49,836 KB
testcase_07 WA -
testcase_08 AC 54 ms
49,988 KB
testcase_09 AC 53 ms
50,144 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 53 ms
49,776 KB
testcase_13 AC 52 ms
49,816 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 52 ms
49,776 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 54 ms
50,132 KB
testcase_33 AC 53 ms
49,724 KB
testcase_34 AC 53 ms
49,652 KB
testcase_35 AC 53 ms
49,768 KB
testcase_36 AC 53 ms
50,096 KB
testcase_37 AC 54 ms
49,732 KB
testcase_38 AC 53 ms
49,928 KB
testcase_39 AC 53 ms
50,148 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 53 ms
49,976 KB
testcase_45 AC 52 ms
49,772 KB
testcase_46 WA -
testcase_47 AC 54 ms
50,068 KB
testcase_48 AC 52 ms
49,836 KB
testcase_49 WA -
testcase_50 AC 53 ms
50,112 KB
testcase_51 AC 53 ms
50,004 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
 
public class Main {
	private static FastScanner sc = new FastScanner();
	
	public static void main(String[] args) {
		int b1 = sc.nextInt();
		int b2 = sc.nextInt();
		int b3 = sc.nextInt();
		
		if(b2 == b1) {
			System.out.println(b3);
			return;
		}

		System.out.println((b3 - b2) * b3 / (b2 - b1) + b2 - ((b3 - b2) * b1 / (b2 - b1)));
	}
	
	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}
0