結果

問題 No.5021 Addition Pyramid
ユーザー komorin95
提出日時 2025-03-21 14:20:38
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,058 bytes
コンパイル時間 15,519 ms
コンパイル使用メモリ 376,804 KB
実行使用メモリ 5,888 KB
スコア 2,074,947
最終ジャッジ日時 2025-03-21 14:20:56
合計ジャッジ時間 16,010 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused imports: `Bytes` and `Usize1`
 --> src/main.rs:5:24
  |
5 | use proconio::marker::{Bytes, Usize1};
  |                        ^^^^^  ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: variable does not need to be mutable
  --> src/main.rs:28:9
   |
28 |     let mut c = vec![0; N];
   |         ----^
   |         |
   |         help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

ソースコード

diff #

// -*- coding:utf-8-unix -*-

use std::sync::OnceLock;
// use once_cell::sync::OnceCell;
use proconio::marker::{Bytes, Usize1};
use proconio::{fastout, input};

const N: usize = 50;

#[fastout]
fn main() {
    let _ = get_time();

    input! {
        n: usize,
    }
    assert_eq!(n, N);

    let mut a = Vec::new();

    for i in 0..N {
        input! {
            ai: [usize; i+1],
        }
        a.push(ai);
    }

    let mut c = vec![0; N];

    for i in 0..N {
        if i > 0 {
            print!(" ");
        }
        print!("{}", c[i]);
    }
}

//
// MARK: Time Measurement
//

static STIME: OnceLock<f64> = OnceLock::new();

fn get_time() -> f64 {
    let t = std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)
        .unwrap();
    let ms = t.as_secs() as f64 + t.subsec_nanos() as f64 * 1e-9;
    let stime = *STIME.get_or_init(|| ms);
    return ms - stime;
}

#[allow(unused)]
#[cfg(debug_assertions)]
const TIME_LIMIT: f64 = 10.;

#[allow(unused)]
#[cfg(not(debug_assertions))]
const TIME_LIMIT: f64 = 2.9;
0