結果
| 問題 |
No.2357 Guess the Function
|
| コンテスト | |
| ユーザー |
Adamantite
|
| 提出日時 | 2023-06-25 01:53:59 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 821 bytes |
| コンパイル時間 | 15,384 ms |
| コンパイル使用メモリ | 166,472 KB |
| 実行使用メモリ | 51,416 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2024-07-02 04:14:01 |
| 合計ジャッジ時間 | 10,056 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 RE * 1 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (122 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
namespace A_GuesstheFunction
{
internal class Program
{
static void Main(string[] args) {
Console.WriteLine("? 100");
int y1 = int.Parse(Console.ReadLine());
if((100 - y1 - 1) == 0) {
//99が返された場合a = 99、b = 100
Console.WriteLine(string.Format("! {0} {1}", 99, 100));
}
Console.WriteLine("? " + (100 - y1 - 1));
int y2 = int.Parse(Console.ReadLine());
int b = y2 + 1;
int a = 0;
for (int i = 1; i < 100; i++) {
if (100 <= i * b + y1) {
a = i * b + y1 - 100;
break;
}
}
Console.WriteLine(string.Format("! {0} {1}", a, b));
}
}
}
Adamantite