Started on abc257

This commit is contained in:
2022-12-05 12:50:59 +01:00
parent 27d00340b9
commit b0fc6d0e58
10 changed files with 122 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "abc257"
version = "0.1.0"
dependencies = [
"proconio",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "proconio"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91c333be3af2936f8e810300bc74fe4d0cc168ebc04ab02a28c5b1060fa1bd59"
dependencies = [
"lazy_static",
]

View File

@@ -0,0 +1,12 @@
[package]
name = "abc257"
version = "0.1.0"
edition = "2021"
# dependencies added to new project
[dependencies]
proconio = "0.4.3"
[profile.release]
lto = true
panic = 'abort'

View File

@@ -0,0 +1,15 @@
use proconio::input;
fn main() {
input!{
n: f32,
x: f32,
};
let l = x / n;
let c = l.ceil() - 1.;
let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
println!("{}", chars.chars().nth(c as usize).unwrap());
}

View File

@@ -0,0 +1,34 @@
use proconio::input;
fn main() {
input!{
n: usize,
k: usize,
q: usize,
a: [usize; k],
l: [usize; q],
};
let mut board = vec![false; n];
let mut positions = vec![0; k];
let mut p = 0;
for pos in a {
board[pos - 1] = true;
positions[p] = pos - 1;
p += 1;
}
for turn in l {
let pos = positions[turn - 1];
if pos != n - 1 && !board[pos + 1] {
board[pos] = false;
board[pos + 1] = true;
positions[turn - 1] = pos + 1;
}
}
for pos in positions {
print!("{} ", pos + 1);
} print!("\n");
}

View File

@@ -0,0 +1,11 @@
use proconio::input;
fn main() {
input!{
n: usize,
s: String,
w: [u64; n],
};
}

View File

@@ -0,0 +1,5 @@
use proconio::input;
fn main() {
todo!();
}

View File

@@ -0,0 +1,5 @@
use proconio::input;
fn main() {
todo!();
}

View File

@@ -0,0 +1,5 @@
use proconio::input;
fn main() {
todo!();
}

View File

@@ -0,0 +1,5 @@
use proconio::input;
fn main() {
todo!();
}

View File

@@ -0,0 +1,5 @@
use proconio::input;
fn main() {
todo!();
}