結果

問題 No.1205 Eye Drops
ユーザー hotman78hotman78
提出日時 2020-08-30 17:12:20
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 3,217 bytes
コンパイル時間 14,542 ms
コンパイル使用メモリ 379,164 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 01:04:37
合計ジャッジ時間 14,260 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 10 ms
5,376 KB
testcase_33 AC 10 ms
5,376 KB
testcase_34 AC 11 ms
5,376 KB
testcase_35 AC 11 ms
5,376 KB
testcase_36 AC 10 ms
5,376 KB
testcase_37 RE -
testcase_38 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `n`
   --> src/main.rs:11:9
    |
11  |         n:usize,m:usize,
    |         ^
    |
help: `n` is captured in macro and introduced a unused variable
   --> src/main.rs:139:13
    |
10  | /     input!{
11  | |         n:usize,m:usize,
12  | |         v:[(i32,i32);m],
13  | |     }
    | |_____- in this macro invocation
...
139 |           let $var = read_value!($iter, $t);
    |               ^^^^
    = note: `#[warn(unused_variables)]` on by default
    = note: this warning originates in the macro `input_inner` which comes from the expansion of the macro `input` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: variable does not need to be mutable
   --> src/main.rs:122:13
    |
10  | /     input!{
11  | |         n:usize,m:usize,
12  | |         v:[(i32,i32);m],
13  | |     }
    | |_____- in this macro invocation
...
122 |           let mut s = {
    |               ----^
    |               |
    |               help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default
    = note: this warning originates in the macro `input` (in Nightly builds, run with -Z macro-backtrace for more info)

ソースコード

diff #

#![allow(unused_imports)]
#![allow(dead_code)]


//use rust::library::data_structure::*;
//use rust::library::math::mod_int;
use crate::rust::*;

fn main() {
    input!{
        n:usize,m:usize,
        v:[(i32,i32);m],
    }
    for i in 0..v.len(){
        if i==0{
            if !(v[i].1<v[i].0){
                println!("{}","No");
                return;
            }
        }else{
            if !((v[i].1-v[i-1].1)<(v[i].0-v[i-1].0).abs()){
                println!("{}","No");
                return;
            }
        }
    }
    println!("{}","Yes");
}




pub mod rust {


pub mod library {


pub mod data_structure {


pub mod union_find {

pub struct UF{
    par:Vec<usize>,
    rank:Vec<usize>,
}
impl UF{
    pub fn new(n:usize)->UF{
        let mut v=vec![0;n];
        for i in 0..n{
            v[i]=i;
        }
        UF{
            par:v,
            rank:vec![1;n],
        }
    }
    pub fn root(&mut self,x:usize)->usize{
        if x==self.par[x]{
            x
        }else{
            let par=self.par[x];
            let res=self.root(par);
            self.par[x]=res;
            res
        }
    }
    pub fn same(&mut self,a:usize,b:usize)->bool{
        self.root(a)==self.root(b)
    }
    pub fn unite(&mut self,a:usize,b:usize)->bool{
        let ap=self.root(a);
        let bp=self.root(b);
        if ap==bp{
            return false;
        }
        if self.rank[ap]<self.rank[bp]{
            self.par[bp]=ap;
            self.rank[ap]+=self.rank[bp];
        }else{
            self.par[ap]=bp;
            self.rank[bp]+=self.rank[ap];
        }
        return true;
    }
    pub fn size(&mut self,a:usize)->usize{
        let ap=self.root(a);
        self.rank[ap]
    }
}

}  // mod union_find

}  // mod data_structure

pub mod math {


pub mod mod_int {

pub fn hello(){
    println!("hello");
}

}  // mod mod_int

}  // mod math

pub mod util {


pub mod io {

#[macro_export]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[macro_export] 
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export] 
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

}  // mod io

}  // mod util

}  // mod library

}  // mod rust

0