結果

問題 No.89 どんどんドーナツどーんといこう!
コンテスト
ユーザー リチウム
提出日時 2014-12-07 19:23:05
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 1,188 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,382 ms
コンパイル使用メモリ 82,136 KB
実行使用メモリ 38,656 KB
最終ジャッジ日時 2026-04-21 07:29:00
合計ジャッジ時間 3,383 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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