結果
| 問題 |
No.172 UFOを捕まえろ
|
| コンテスト | |
| ユーザー |
bayashiko_r
|
| 提出日時 | 2018-11-12 00:56:23 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 5,000 ms |
| コード長 | 578 bytes |
| コンパイル時間 | 713 ms |
| コンパイル使用メモリ | 107,772 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-12-16 02:08:00 |
| 合計ジャッジ時間 | 2,030 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Program {
static void Main(string[] args) {
//入力
string s = Console.ReadLine();
string[] t = s.Split(' ');
//数字の割り当て
int x = int.Parse(t[0]);
int y = int.Parse(t[1]);
int r = int.Parse(t[2]);
//答えとなる数値
int ans = 0;
//中心の座標までの距離
ans += Math.Abs(x) + Math.Abs(y);
//半径分をさらに足す
ans += (int)Math.Ceiling(r * Math.Sqrt(2));
//出力
Console.WriteLine(ans);
}
}
bayashiko_r