結果
| 問題 | 
                            No.2765 Cross Product
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-05-31 21:26:41 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 2,000 ms | 
| コード長 | 1,557 bytes | 
| コンパイル時間 | 15,615 ms | 
| コンパイル使用メモリ | 391,320 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-20 22:22:01 | 
| 合計ジャッジ時間 | 15,569 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 23 | 
コンパイルメッセージ
warning: unused import: `std::cmp::max` --> src/main.rs:1:5 | 1 | use std::cmp::max; | ^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused variable: `test_cases` --> src/main.rs:6:9 | 6 | let test_cases:u32; | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_cases` | = note: `#[warn(unused_variables)]` on by default warning: variable `INPUT` should have a snake case name --> src/main.rs:8:13 | 8 | let mut INPUT = io::BufReader::new(stdin.lock()).lines().map(Result::unwrap); | ^^^^^ help: convert the identifier to snake case: `input` | = note: `#[warn(non_snake_case)]` on by default warning: variable `OUTPUT` should have a snake case name --> src/main.rs:9:13 | 9 | let mut OUTPUT = io::BufWriter::new(io::stdout().lock()); | ^^^^^^ help: convert the identifier to snake case: `output` warning: variable `Avec` should have a snake case name --> src/main.rs:14:9 | 14 | let Avec = inp.split_ascii_whitespace().map(|x| x.parse::<i32>().unwrap()).collect::<Vec<_>>(); | ^^^^ help: convert the identifier to snake case: `avec` warning: variable `Bvec` should have a snake case name --> src/main.rs:15:9 | 15 | let Bvec = INPUT.next().unwrap().split_ascii_whitespace().map(|x| x.parse::<i32>().unwrap()).collect::<Vec<_>>(); | ^^^^ help: convert the identifier to snake case: `bvec`
ソースコード
use std::cmp::max;
use std::io;
use std::io::{Write, BufRead};
pub fn main(){
    let test_cases:u32;
    let stdin = io::stdin();
    let mut INPUT = io::BufReader::new(stdin.lock()).lines().map(Result::unwrap);
    let mut OUTPUT = io::BufWriter::new(io::stdout().lock());
    
    // test_cases = INPUT.next().unwrap().parse().unwrap();
    let inp = INPUT.next().unwrap();
    let Avec = inp.split_ascii_whitespace().map(|x| x.parse::<i32>().unwrap()).collect::<Vec<_>>();
    let Bvec = INPUT.next().unwrap().split_ascii_whitespace().map(|x| x.parse::<i32>().unwrap()).collect::<Vec<_>>();
    let cx = Avec[1]*Bvec[2] - Avec[2]*Bvec[1];
    let cy = Avec[2]*Bvec[0] - Avec[0]*Bvec[2];
    let cz = Avec[0]*Bvec[1] - Avec[1]*Bvec[0];
    writeln!(OUTPUT, "{} {} {}", cx, cy, cz).unwrap();
//    for _ in 0..test_cases{
//         let inp = INPUT.next().unwrap();
//         let mut inpit = inp.split_ascii_whitespace();
//         let n: u64 = inpit.next().unwrap().parse().unwrap();
//         let m:u64 = inpit.next().unwrap().parse().unwrap();
//         let mut an = n+m;
//         let mut ans =0u64;
//         let mr = 2*m; 
//         let mut curr = 0u64; let mut rpow = 1u64;
//         while an !=0 {
//             if an & 1 ==1 {
//                 ans += rpow;
//                 curr += rpow; 
//             } else {
//                 if curr < mr {ans += rpow;}
//             }
//             an/=2; rpow *=2;
//         }
//         writeln!(OUTPUT, "{}", ans).unwrap();
//    }
}