結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー LeonardoneLeonardone
提出日時 2017-11-24 06:14:05
言語 Rust
(1.77.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 512 bytes
コンパイル時間 10,137 ms
コンパイル使用メモリ 391,640 KB
最終ジャッジ日時 2024-04-27 02:30:20
合計ジャッジ時間 10,813 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
error[E0283]: type annotations needed
  --> src/main.rs:20:13
   |
20 |         sum += get!();
   |             ^^ cannot infer type
   |
   = note: multiple `impl`s satisfying `u64: AddAssign<_>` found in the `core` crate:
           - impl AddAssign for u64;
           - impl AddAssign<&u64> for u64;

For more information about this error, try `rustc --explain E0283`.
error: could not compile `main` (bin "main") due to 1 previous error

ソースコード

diff #

// yukicoder My Practice
// author: Leonardone @ NEETSDKASU

fn main() {
    
    let mut stdin = String::new();
    {
        use std::io::Read;
        std::io::stdin().read_to_string(&mut stdin).expect("failed to read string");    
    }
    let mut stdin = stdin.split_whitespace();
    
    macro_rules! get { () => ( stdin.next().unwrap().parse().unwrap() ) }
    
    let n: u32 = get!();
    
    let mut sum: u64 = 0;
    
    for _ in 0..n {
        sum += get!();
    }
    
    println!("{}", sum);
}
0