結果
| 問題 | No.3084 Identify f(x) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-03-22 15:24:07 | 
| 言語 | Rust (1.83.0 + proconio) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 759 bytes | 
| コンパイル時間 | 12,237 ms | 
| コンパイル使用メモリ | 402,052 KB | 
| 実行使用メモリ | 26,240 KB | 
| 平均クエリ数 | 2.29 | 
| 最終ジャッジ日時 | 2025-04-04 20:52:12 | 
| 合計ジャッジ時間 | 12,707 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 RE * 3 | 
コンパイルメッセージ
warning: unused imports: `Write` and `stdout`
 --> src/main.rs:1:22
  |
1 | use std::io::{stdin, stdout, BufReader, Write};
  |                      ^^^^^^             ^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
            
            ソースコード
use std::io::{stdin, stdout, BufReader, Write};
use proconio::{input, source::line::LineSource}; // source::line を使用
fn main() {
    let stdin = stdin();
    let mut source = LineSource::new(BufReader::new(stdin.lock())); // LineSourceで1行ずつ入力を読む設定
    
    let mut x = 0;
    println!("? {}", x);// 改行あり(通常は自動でflushされる)
    input! {
        from &mut source, // リアルタイム入力の指定
        f0: usize,         // ジャッジから対応するRを受け取り、f0に代入
    }
    
    x = 1;
    println!("? {}", x);
    input! {
    	from &mut source,
    	f1: usize,
    }
    
    //求めるa,bを計算し、出力
    let a = f1-f0;
    let b = f0;
    println!("! {} {}", a, b);
}
            
            
            
        