結果
問題 | No.2357 Guess the Function |
ユーザー |
![]() |
提出日時 | 2023-06-25 01:54:35 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 79 ms / 1,000 ms |
コード長 | 845 bytes |
コンパイル時間 | 7,827 ms |
コンパイル使用メモリ | 171,936 KB |
実行使用メモリ | 45,784 KB |
平均クエリ数 | 2.91 |
最終ジャッジ日時 | 2024-07-02 04:14:39 |
合計ジャッジ時間 | 9,757 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (102 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)); return; } 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)); } } }