結果

問題 No.89 どんどんドーナツどーんといこう!
ユーザー リチウムリチウム
提出日時 2014-12-07 19:23:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 1,188 bytes
コンパイル時間 3,821 ms
コンパイル使用メモリ 76,904 KB
実行使用メモリ 36,932 KB
最終ジャッジ日時 2024-04-15 19:31:27
合計ジャッジ時間 5,030 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
36,656 KB
testcase_01 AC 57 ms
36,428 KB
testcase_02 AC 57 ms
36,328 KB
testcase_03 AC 58 ms
36,660 KB
testcase_04 AC 57 ms
36,316 KB
testcase_05 AC 58 ms
36,932 KB
testcase_06 AC 57 ms
36,236 KB
testcase_07 AC 57 ms
36,112 KB
testcase_08 AC 57 ms
36,752 KB
testcase_09 AC 59 ms
36,312 KB
testcase_10 AC 57 ms
36,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.lang.Math;
public class ppp {
			
  public static void main(String[] args) {
	  MyScanner sc=new MyScanner();
	  double c=sc.nextInt();
	  double nai=sc.nextInt();
	  double gai=sc.nextInt();
	  double a=(gai-nai)/2;
	  double b=(nai+gai)/2;
	  System.out.println(2*c*a*a*b*Math.PI*Math.PI);
	  
}
}

class MyScanner {
	int nextInt() {
		try {
			int c = System.in.read();
			while (c != '-' && (c < '0' || '9' < c))
				c = System.in.read();
			if (c == '-')
				return -nextInt();
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = System.in.read();
			} while ('0' <= c && c <= '9');
			return res;
		} catch (Exception e) {
			return -1;
		}
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	String next() {
		try {
			StringBuilder res = new StringBuilder("");
			int c = System.in.read();
			while (Character.isWhitespace(c))
				c = System.in.read();
			do {
				res.append((char) c);
			} while (!Character.isWhitespace(c = System.in.read()));
			return res.toString();
		} catch (Exception e) {
			return null;
		}
	}
}
0