結果

問題 No.2714 Amaou
ユーザー ARCANAARCANA
提出日時 2024-04-05 21:47:53
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,271 bytes
コンパイル時間 935 ms
コンパイル使用メモリ 191,236 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-05 21:47:55
合計ジャッジ時間 1,741 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 1 ms
6,676 KB
testcase_16 AC 1 ms
6,676 KB
testcase_17 AC 1 ms
6,676 KB
testcase_18 AC 1 ms
6,676 KB
testcase_19 AC 1 ms
6,676 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 AC 1 ms
6,676 KB
testcase_22 AC 1 ms
6,676 KB
testcase_23 AC 1 ms
6,676 KB
testcase_24 AC 1 ms
6,676 KB
testcase_25 AC 1 ms
6,676 KB
testcase_26 AC 1 ms
6,676 KB
testcase_27 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: struct `Graph` is never constructed
 --> Main.rs:3:8
  |
3 | struct Graph {
  |        ^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: struct `WeightGraph` is never constructed
 --> Main.rs:7:8
  |
7 | struct WeightGraph {
  |        ^^^^^^^^^^^

warning: struct `Point` is never constructed
  --> Main.rs:12:8
   |
12 | struct Point {
   |        ^^^^^

warning: struct `PointGroup` is never constructed
  --> Main.rs:17:8
   |
17 | struct PointGroup{
   |        ^^^^^^^^^^

warning: structure field `adjMatrixs` should have a snake case name
 --> Main.rs:5:5
  |
5 |     adjMatrixs: Vec<Vec<i32>>,
  |     ^^^^^^^^^^ help: convert the identifier to snake case: `adj_matrixs`
  |
  = note: `#[warn(non_snake_case)]` on by default

warning: 5 warnings emitted

ソースコード

diff #

// graph
struct Graph {
    node: i32,
    adjMatrixs: Vec<Vec<i32>>,
}
struct WeightGraph {
    node: i32,
    weight: Vec<Vec<i32>>,
}
// points
struct Point {
    x: i32,
    y: i32,
}

struct PointGroup{
    n: i32,
    point:Point,
}

use std::io;

fn read_line() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s
}

macro_rules! from_line {
    ($($a:ident : $t:ty),+) => {
        $(let $a: $t;)+
        {
            let _line = read_line();
            let mut _it = _line.trim().split_whitespace();
            $($a = _it.next().unwrap().parse().unwrap();)+
            assert!(_it.next().is_none());
        }
    };
}

fn solve(){
    from_line!(n: usize);
    let mut s = vec![vec![String::new();4];n];
    let model = ["akai", "marui", "okii", "umai"];
    for i in 0..n{
        from_line!(a:String,b:String,c:String,d:String);
        s[i] = vec![a,b,c,d];
    }
    let mut count = 0;
    'counter: for i in 0..n{
        s[i].sort();
   //     println!("{:?}",s[i]);
        for j in 0..4{
            if s[i][j] != model[j]{
                continue 'counter;
            }
        }
        count += 1;
   //     println!("{} {}",i,count);
    }
    println!("{}",count);
    
}
fn main() {
    solve();
}
0