cargo: fmt

This commit is contained in:
Muhammad Nauman Raza 2025-02-09 13:19:50 +00:00
parent 5b99663d99
commit 387cbcb94c
Signed by: devraza
GPG key ID: 91EAD6081011574B
22 changed files with 120 additions and 63 deletions

View file

@ -11,7 +11,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let s: Vec<i64> = s.split_whitespace().map(|d| d.parse::<i64>().unwrap()).collect();
let s: Vec<i64> = s
.split_whitespace()
.map(|d| d.parse::<i64>().unwrap())
.collect();
people += s[1] - s[0];

View file

@ -9,7 +9,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a: Vec<u64> = s.split_whitespace().map(|d| d.parse::<u64>().unwrap()).collect();
let a: Vec<u64> = s
.split_whitespace()
.map(|d| d.parse::<u64>().unwrap())
.collect();
if a[0] % 2 == a[1] % 2 {
if a[1].pow(2) > a[0] {

View file

@ -9,7 +9,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut a: Vec<u64> = s.split_whitespace().map(|d| d.parse::<u64>().unwrap()).collect();
let mut a: Vec<u64> = s
.split_whitespace()
.map(|d| d.parse::<u64>().unwrap())
.collect();
a.sort();
a.reverse();

View file

@ -9,7 +9,10 @@ fn main() {
let mut p = String::new();
io::stdin().read_line(&mut p).unwrap();
let drinks = p.split_whitespace().map(|c| c.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let drinks = p
.split_whitespace()
.map(|c| c.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
let conc = drinks.iter().sum::<u64>() as f64 / n as f64;

View file

@ -22,10 +22,10 @@ fn main() {
match j {
'q' => {
new.push('p');
},
}
'p' => {
new.push('q');
},
}
_ => {
new.push('w');
}

View file

@ -1,5 +1,5 @@
use std::io;
use std::collections::HashSet;
use std::io;
fn main() {
let mut s = String::new();

View file

@ -6,7 +6,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a: Vec<u64> = s.split_whitespace().map(|d| d.parse::<u64>().unwrap()).collect();
let a: Vec<u64> = s
.split_whitespace()
.map(|d| d.parse::<u64>().unwrap())
.collect();
let mut evenness = vec![];
for i in a {

View file

@ -17,7 +17,11 @@ fn main() {
.chain(balance.chars().skip(balance.len() - 1))
.collect();
let options_str: [&str; 3] = [&balance[0..balance.len()-1], &removed, &balance[0..balance.len()]];
let options_str: [&str; 3] = [
&balance[0..balance.len() - 1],
&removed,
&balance[0..balance.len()],
];
let options = options_str.map(|i| i.parse::<i64>().unwrap());
println!("{}", options.iter().max().unwrap());

View file

@ -4,7 +4,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let input = s.split_whitespace().map(|s| s.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let input = s
.split_whitespace()
.map(|s| s.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
let n = input[0];
let k = input[1];

View file

@ -4,14 +4,20 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a = s.split_whitespace().map(|s| s.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let a = s
.split_whitespace()
.map(|s| s.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
let n: usize = a[0] as usize;
let m: usize = a[1] as usize;
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut f = s.split_whitespace().map(|s| s.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let mut f = s
.split_whitespace()
.map(|s| s.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
f.sort();
@ -27,4 +33,3 @@ fn main() {
println!("{}", minimum);
}

View file

@ -4,7 +4,11 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut nums = s.trim().split('+').map(String::from).collect::<Vec<String>>();
let mut nums = s
.trim()
.split('+')
.map(String::from)
.collect::<Vec<String>>();
nums.sort();

View file

@ -4,13 +4,21 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a1 = s.trim().split_whitespace().map(|i| i.parse::<i64>().unwrap()).collect::<Vec<i64>>();
let a1 = s
.trim()
.split_whitespace()
.map(|i| i.parse::<i64>().unwrap())
.collect::<Vec<i64>>();
let max = a1[1];
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut a2 = s.trim().split_whitespace().map(|i| i.parse::<i64>().unwrap()).collect::<Vec<i64>>();
let mut a2 = s
.trim()
.split_whitespace()
.map(|i| i.parse::<i64>().unwrap())
.collect::<Vec<i64>>();
let mut cost = 0;
let mut count = 0;

View file

@ -7,11 +7,17 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let mut initial = s.split_whitespace().map(|s| s.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let mut initial = s
.split_whitespace()
.map(|s| s.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
initial.sort();
let output = initial.iter().map(|d| d.to_string()).collect::<Vec<String>>();
let output = initial
.iter()
.map(|d| d.to_string())
.collect::<Vec<String>>();
println!("{}", output.join(" "));
}

View file

@ -4,7 +4,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a = s.split_whitespace().map(|i| i.parse::<i64>().unwrap()).collect::<Vec<i64>>();
let a = s
.split_whitespace()
.map(|i| i.parse::<i64>().unwrap())
.collect::<Vec<i64>>();
let mut n = a[0];
let mut m = a[1];

View file

@ -4,7 +4,11 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let inp = s.trim().split_whitespace().map(|i| i.parse::<f64>().unwrap()).collect::<Vec<f64>>();
let inp = s
.trim()
.split_whitespace()
.map(|i| i.parse::<f64>().unwrap())
.collect::<Vec<f64>>();
let n = inp[0];
let m = inp[1];

View file

@ -8,7 +8,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a = s.split_whitespace().map(|n| n.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let a = s
.split_whitespace()
.map(|n| n.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
let mut maximum = 1;
let mut count = 1;

View file

@ -25,5 +25,4 @@ fn main() {
println!("{}", total);
total = 0;
}
}

View file

@ -4,7 +4,10 @@ fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let a = s.split_whitespace().map(|s| s.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let a = s
.split_whitespace()
.map(|s| s.parse::<u64>().unwrap())
.collect::<Vec<u64>>();
let mut l = a[0];
let mut b = a[1];