提出 #51800839
ソースコード 拡げる
// -*- coding:utf-8-unix -*-
/*
このコード、と~おれ!
∧_∧
(。・ω・。)つ━☆・*。
⊂ ノ ・゜+.
しーJ °。+ *´¨)
.· ´¸.·*´¨) ¸.·*¨)
(¸.·´ (¸.·'* ☆
*/
#[allow(unused_imports)]
use ac_library::*;
use itertools::Itertools;
use proconio::input;
use proconio::marker::Chars;
use std::collections::{BinaryHeap, VecDeque};
static INF: usize = 1e18 as usize;
trait ChLibs<T: std::cmp::Ord> {
fn chmin(&mut self, elm: T) -> bool;
fn chmax(&mut self, elm: T) -> bool;
}
impl<T: std::cmp::Ord> ChLibs<T> for T {
fn chmin(&mut self, elm: T) -> bool {
return
if *self > elm { *self = elm; true }
else { false }
}
fn chmax(&mut self, elm: T) -> bool {
return
if *self < elm { *self = elm; true }
else { false }
}
}
trait Vector<T> {
fn insertion_sort(&mut self, elem: T);
fn print_continuous(&self);
fn print_space_separate(&self);
fn print_linebreak(&self);
}
impl<T: std::cmp::Ord + std::fmt::Display> Vector<T> for Vec<T> {
fn insertion_sort(&mut self, elem: T) { let idx = self.binary_search(&elem).unwrap_or_else(|x| x); self.insert(idx, elem); }
fn print_continuous(&self) { for i in 0..self.len() { print!("{}", self[i]); } println!() }
fn print_space_separate(&self) { for i in 0..self.len() { print!("{}", self[i]); if i != self.len()-1 { print!(" ") } } println!() }
fn print_linebreak(&self) { for i in 0..self.len() { println!("{}", self[i]); } }
}
fn solve(){
input! {
n: usize,
k: u64,
a: [u64; n]
}
let mut res = vec![];
for x in &a {
if *x % k == 0 {
res.push(*x / k);
}
}
res.print_space_separate();
}
fn main() {
// input! { i: usize }
let mut i = 1;
while i != 0 { solve(); i -= 1; }
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - Divisible |
| ユーザ | ardRiriy |
| 言語 | Rust (rustc 1.70.0) |
| 得点 | 100 |
| コード長 | 1944 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 2128 KiB |
コンパイルエラー
warning: unused import: `itertools::Itertools`
--> src/main.rs:14:5
|
14 | use itertools::Itertools;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `proconio::marker::Chars`
--> src/main.rs:16:5
|
16 | use proconio::marker::Chars;
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `BinaryHeap`, `VecDeque`
--> src/main.rs:17:24
|
17 | use std::collections::{BinaryHeap, VecDeque};
| ^^^^^^^^^^ ^^^^^^^^
warning: static `INF` is never used
--> src/main.rs:20:8
|
20 | static INF: usize = 1e18 as usize;
| ^^^
|
= note: `#[warn(dead_code)]` on by default
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 1996 KiB |
| 00_sample_02.txt | AC | 1 ms | 1912 KiB |
| 00_sample_03.txt | AC | 1 ms | 2032 KiB |
| 01_test_01.txt | AC | 1 ms | 1932 KiB |
| 01_test_02.txt | AC | 1 ms | 2124 KiB |
| 01_test_03.txt | AC | 0 ms | 1856 KiB |
| 01_test_04.txt | AC | 1 ms | 2056 KiB |
| 01_test_05.txt | AC | 1 ms | 2124 KiB |
| 01_test_06.txt | AC | 0 ms | 1956 KiB |
| 01_test_07.txt | AC | 0 ms | 1924 KiB |
| 01_test_08.txt | AC | 1 ms | 1932 KiB |
| 01_test_09.txt | AC | 1 ms | 2128 KiB |
| 01_test_10.txt | AC | 1 ms | 1996 KiB |
| 01_test_11.txt | AC | 1 ms | 2120 KiB |
| 01_test_12.txt | AC | 1 ms | 2056 KiB |