提出 #72689613


ソースコード 拡げる

#![allow(non_snake_case, unused_imports, unused_macros)]
use ac_library::*;
use itertools::Itertools;
use proconio::{fastout, input, marker::Usize1};

macro_rules! debug {
    ($($a:expr),* $(,)*) => {
        #[cfg(debug_assertions)]
        eprintln!(concat!($("| ", stringify!($a), "={:?} "),*, "|"), $(&$a),*);
    };
}

#[fastout]
fn main() {
    input! {
        n: usize, m: usize,
        ab: [(Usize1, Usize1); m]
    }
    let mut n_friend = vec![0_usize; n];
    for (ai, bi) in ab {
        n_friend[ai] += 1;
        n_friend[bi] += 1;
    }
    println!(
        "{}",
        n_friend
            .into_iter()
            .map(|c| (n - c - 1) * (n - c).wrapping_sub(2) * (n - c).wrapping_sub(3) / 6)
            .join(" ")
    );
}

提出情報

提出日時
問題 C - Peer Review
ユーザ wasabiEater
言語 Rust (rustc 1.89.0)
得点 300
コード長 778 Byte
結果 AC
実行時間 23 ms
メモリ 11880 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 25
セット名 テストケース
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 2092 KiB
sample01.txt AC 0 ms 2084 KiB
sample02.txt AC 0 ms 2096 KiB
testcase00.txt AC 0 ms 1956 KiB
testcase01.txt AC 7 ms 7024 KiB
testcase02.txt AC 16 ms 7856 KiB
testcase03.txt AC 11 ms 5948 KiB
testcase04.txt AC 11 ms 4296 KiB
testcase05.txt AC 11 ms 5872 KiB
testcase06.txt AC 8 ms 8816 KiB
testcase07.txt AC 23 ms 11880 KiB
testcase08.txt AC 13 ms 4836 KiB
testcase09.txt AC 13 ms 5020 KiB
testcase10.txt AC 1 ms 2220 KiB
testcase11.txt AC 13 ms 4980 KiB
testcase12.txt AC 11 ms 5828 KiB
testcase13.txt AC 11 ms 5888 KiB
testcase14.txt AC 6 ms 3176 KiB
testcase15.txt AC 13 ms 4940 KiB
testcase16.txt AC 5 ms 2908 KiB
testcase17.txt AC 13 ms 4968 KiB
testcase18.txt AC 10 ms 3916 KiB
testcase19.txt AC 7 ms 3432 KiB
testcase20.txt AC 13 ms 5080 KiB
testcase21.txt AC 22 ms 10148 KiB