add unsolved

This commit is contained in:
2026-04-27 10:21:50 +09:00
parent fe8128ab65
commit 9abd51b9b8
10 changed files with 385 additions and 0 deletions

14
storage/zeta/rs/10973.rs Normal file
View File

@@ -0,0 +1,14 @@
use std::io::stdin;
fn main() {
let mut line = String::new();
stdin().read_line(&mut line).unwrap();
let n: usize = line.trim().parse::<usize>();
line.clear();
stdin().read_line(&mut line).unwrap();
let iter = line
.trim()
.split_whitespace()
.map(|x| x.parse::<u32>().unwrap());
}

19
storage/zeta/rs/11694.rs Normal file
View File

@@ -0,0 +1,19 @@
use std::io::{read_to_string, stdin};
fn main() {
let temp = read_to_string(stdin()).unwrap();
let mut iter = temp
.split_ascii_whitespace()
.map(|x| x.parse::<usize>().unwrap());
let n = iter.next().unwrap();
let p = (0..n).map(|_| iter.next().unwrap() - 1);
let flg = p.fold(0, |acc, x| acc ^ x);
if flg == 0 {
println!("cubelover");
} else {
println!("koosaga");
}
}

17
storage/zeta/rs/20555.rs Normal file
View File

@@ -0,0 +1,17 @@
use std::io::stdin;
fn main() {
let mut line = String::new();
stdin().read_line(&mut line).unwrap();
let n = line.trim().parse::<usize>().unwrap();
let words = (0..n)
.map(|_| {
line.clear();
stdin().read_line(&mut line).unwrap();
line.trim().chars().collect()
})
.collect::<Vec<Vec<_>>>();
}

62
storage/zeta/rs/27438.rs Normal file
View File

@@ -0,0 +1,62 @@
use std::io::{read_to_string, stdin};
fn main() {
let temp = read_to_string(stdin()).unwrap();
let mut iter = temp
.split_ascii_whitespace()
.map(|x| x.parse::<usize>().unwrap());
let n = iter.next().unwrap() - 1;
let mut levels = vec![1, 19];
// 10666
// 11666
// 1
// 10 + 8
// 100 + 8 * 10 + 81 *
// 1000 + 8 * 100 + 81 * 10 + 810
// 10000 + 8 * 1000 + 81 * 100
//
// 66600
// 106660
// 166600
// 266600
// 566600
// 1000666
// 200166
// 2666000
// 3666000
// 7666000
// 1066600
// 1166600
// 1266600
// 13
// 6066600
// 1000666
// 10
// 6660000
// 0 666
// 1 1666
// 2 2666
// 3 3666
// 4 4666
// 5 5666
// 6 6660
// 7 6661
//
//15 6669
//16 7666
//17 8666
//18 9666
//1
let mut delta = 18;
let mut s = 81;
for _ in 0..5 {
delta = delta * 10 + s;
s = s * 10;
levels.push(levels.last().unwrap() + delta);
}
println!("{:?}", levels);
}

88
storage/zeta/rs/31190.rs Normal file
View File

@@ -0,0 +1,88 @@
use std::{
collections::HashMap,
io::{read_to_string, stdin},
};
fn main() {
let temp = read_to_string(stdin()).unwrap();
let mut iter = temp
.split_ascii_whitespace()
.map(|x| x.parse::<usize>().unwrap());
let m = iter.next().unwrap();
let n = iter.next().unwrap();
let arr = (0..n).map(|_| iter.next().unwrap()).collect::<Vec<_>>();
let mut cnts: HashMap<usize, usize> = HashMap::new();
let mut changes = vec![vec![]; m];
for &e in arr.iter() {
let (q, s) = ((e / m), (e % m));
*cnts.entry(q).or_insert(0) += 1;
let next_d = s + 1;
if next_d < m {
changes[next_d].push(q);
}
}
let mut cnt = cnts.len();
let mut best_ds = vec![];
let mut best_cnt = cnt;
let mut curr_d = 1;
let mut curr_cnt = cnt;
let mut changes_sorted = vec![];
for d in 1..m {
for &q in &changes[d] {
changes_sorted.push((d, q));
}
}
changes_sorted.sort_by_key(|&(d, _)| d);
let mut idx = 0;
while idx < changes_sorted.len() {
let d = changes_sorted[idx].0;
if d > curr_d {
if curr_cnt > best_cnt {
best_cnt = curr_cnt;
best_ds.clear();
best_ds.push(curr_d);
} else if curr_cnt == best_cnt {
best_ds.push(curr_d);
}
}
while idx < changes_sorted.len() && changes_sorted[idx].0 == d {
let q = changes_sorted[idx].1;
let cnt_q = cnts.entry(q).or_insert(1);
*cnt_q -= 1;
if *cnt_q == 0 {
cnts.remove(&q);
curr_cnt -= 1;
}
let cnt_qm = cnts.entry(q - 1).or_insert(0);
if *cnt_qm == 0 {
curr_cnt += 1;
}
*cnt_qm += 1;
idx += 1;
}
curr_d = d;
}
if curr_d <= m - 1 {
if curr_cnt > best_cnt {
best_cnt = curr_cnt;
best_ds.clear();
best_ds.push(curr_d);
}
}
println!("{:?}", best_ds);
}

15
storage/zeta/rs/31700.rs Normal file
View File

@@ -0,0 +1,15 @@
use std::io::{read_to_string, stdin};
fn main() {
let temp = read_to_string(stdin()).unwrap();
let mut iter = temp.split_ascii_whitespace().map(|x| x.parse::<usize>().unwrap());
let h = iter.next().unwrap();
let w = iter.next().unwrap();
let n = iter.next().unwrap();
let ds = (0..n).map(|_| iter.next().unwrap()).collect::<Vec<_>>();
}