0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

初心者プログラマーがAtCoderに挑んだ軌跡-ABC412-A-

Posted at

ABC412-A

問題の内容

連続した数値比較

言語

Rust

解法

inputをforループで回す等を思いついた。
ただ、proconioには便利な書き方がありそれを使用した。

課題

二次元配列の読み込み

学んだこと

ab: [(i64, i64); n]と書けば
a b
1 2
2 2
3 3
みたいな配列を読み込める

提出内容

use proconio::input;

fn main() {
  input! {
    n: usize,
    ab: [(i64, i64); n],
  }
  let mut count = 0;
  for (a, b) in ab {
    if a < b {
      count += 1;
    }
  }
  println!("{}", count);
}

成績

  • 213Byte
  • AC
  • 1ms
  • 2044KiB
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?