[Rust] 백준 2630번 색종이 만들기
use std::io; fn recursive (vec: &Vec, white: &mut i32, blue: &mut i32, r :i32, c :i32, length: i32) { let start = vec.get(r as usize).unwrap().get(c as usize).unwrap(); for i in r..r+length { for j in c..c+length { if vec.get(i as usize).unwrap().get(j as usize).unwrap() != start { recursive (vec,white,blue,r,c,length/2); recursive (vec,white,blue,r,c + length/2,length/2); recursive (vec,white,b..
[Rust] 백준 2754번 학점계산
use std::io; use std::collections::HashMap; fn main() { let grade = vec![String::from("A+"),String::from("A0"),String::from("A-"), String::from("B+"),String::from("B0"),String::from("B-"), String::from("C+"),String::from("C0"),String::from("C-"), String::from("D+"),String::from("D0"),String::from("D-"), String::from("F")]; let score = vec![4.3, 4.0, 3.7, 3.3, 3.0, 2.7, 2.3, 2.0, 1.7, 1.3, 1.0, 0..