結果
| 問題 |
No.3295 Buying Bottled Water
|
| コンテスト | |
| ユーザー |
aketijyuuzou
|
| 提出日時 | 2025-10-05 13:56:11 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,497 bytes |
| コンパイル時間 | 7,219 ms |
| コンパイル使用メモリ | 169,724 KB |
| 実行使用メモリ | 187,828 KB |
| 最終ジャッジ日時 | 2025-10-05 13:56:27 |
| 合計ジャッジ時間 | 9,242 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 2 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (93 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("700");
//2
}
else if (InputPattern == "Input2") {
WillReturn.Add("550");
//1
}
else if (InputPattern == "Input3") {
WillReturn.Add("2300");
//5
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static long[] GetSplitArr(string pStr)
{
return (pStr == "" ? new string[0] : pStr.Split(' ')).Select(pX => long.Parse(pX)).ToArray();
}
static long mN;
static void Main()
{
List<string> InputList = GetInputList();
mN = long.Parse(InputList[0]);
long L = 0;
long R = mN;
if (mN < 100) {
Console.WriteLine(0);
}
while (L + 1 < R) {
long Mid = (L + R) / 2;
if (CanAchieve(Mid)) {
R = Mid;
}
else {
L = Mid;
}
}
Console.WriteLine(R);
}
// Xが解かをを返す
static bool CanAchieve(long pX)
{
long Result = mN - 500 * pX;
return Result < 100;
}
}
aketijyuuzou