QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#755091 | #9557. Temperance | ucup-team296# | AC ✓ | 212ms | 46564kb | Rust | 14.7kb | 2024-11-16 16:26:41 | 2024-11-16 16:26:42 |
Judging History
answer
//
pub mod solution {
//{"name":"j","group":"Manual","url":"","interactive":false,"timeLimit":2000,"tests":[{"input":"","output":""}],"testType":"single","input":{"type":"stdin","fileName":null,"pattern":null},"output":{"type":"stdout","fileName":null,"pattern":null},"languages":{"java":{"taskClass":"j"}}}
use std::collections::HashMap;
#[allow(unused)]
use crate::dbg;
use crate::algo_lib::io::input::Input;
use crate::algo_lib::io::output::Output;
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
struct Line {
cnt: usize,
coord: usize,
val: i32,
}
fn solve(input: &mut Input, out: &mut Output, _test_case: usize) {
let tc = input.usize();
for _ in 0..tc {
let n = input.usize();
let mut by_coord = vec![HashMap::<i32, Vec<usize>>::new(); 3];
for i in 0..n {
let p = [input.i32(), input.i32(), input.i32()];
for j in 0..3 {
by_coord[j].entry(p[j]).or_default().push(i);
}
}
let mut lines = vec![];
for i in 0..3 {
for (val, coords) in by_coord[i].iter() {
lines.push(Line {
cnt: coords.len(),
coord: i,
val: *val,
});
}
}
lines.sort();
lines.reverse();
let mut alive = vec![false; n];
let mut cnt_alive = 0;
let mut can_alive = vec![0; n + 1];
for line in lines.iter() {
for &i in by_coord[line.coord][&line.val].iter() {
if !alive[i] {
alive[i] = true;
cnt_alive += 1;
}
}
let dencity = line.cnt;
can_alive[dencity] = cnt_alive;
}
for i in (0..can_alive.len() - 1).rev() {
let z = can_alive[i + 1];
can_alive[i] = z.max(can_alive[i]);
}
for i in 0..can_alive.len() {
can_alive[i] = n - can_alive[i];
}
out.println(can_alive[1..].to_vec());
}
}
pub(crate) fn run(mut input: Input, mut output: Output) -> bool {
solve(&mut input, &mut output, 1);
output.flush();
true
}
}
pub mod algo_lib {
pub mod io {
pub mod input {
use std::fmt::Debug;
use std::io::Read;
use std::marker::PhantomData;
use std::path::Path;
use std::str::FromStr;
pub struct Input {
input: Box<dyn Read>,
buf: Vec<u8>,
at: usize,
buf_read: usize,
}
macro_rules! read_integer_fun {
($t:ident) => {
#[allow(unused)]
pub fn $t(&mut self) -> $t {
self.read_integer()
}
};
}
impl Input {
const DEFAULT_BUF_SIZE: usize = 4096;
///
/// Using with stdin:
/// ```no_run
/// use algo_lib::io::input::Input;
/// let stdin = std::io::stdin();
/// let input = Input::new(Box::new(stdin));
/// ```
///
/// For read files use ``new_file`` instead.
///
///
pub fn new(input: Box<dyn Read>) -> Self {
Self {
input,
buf: vec![0; Self::DEFAULT_BUF_SIZE],
at: 0,
buf_read: 0,
}
}
pub fn new_stdin() -> Self {
let stdin = std::io::stdin();
Self::new(Box::new(stdin))
}
pub fn new_file<P: AsRef<Path>>(path: P) -> Self {
let file = std::fs::File::open(&path)
.unwrap_or_else(|_| panic!("Can't open file: {:?}", path.as_ref().as_os_str()));
Self::new(Box::new(file))
}
pub fn new_with_size(input: Box<dyn Read>, buf_size: usize) -> Self {
Self {
input,
buf: vec![0; buf_size],
at: 0,
buf_read: 0,
}
}
pub fn new_file_with_size<P: AsRef<Path>>(path: P, buf_size: usize) -> Self {
let file = std::fs::File::open(&path)
.unwrap_or_else(|_| panic!("Can't open file: {:?}", path.as_ref().as_os_str()));
Self::new_with_size(Box::new(file), buf_size)
}
pub fn get(&mut self) -> Option<u8> {
if self.refill_buffer() {
let res = self.buf[self.at];
self.at += 1;
Some(res)
} else {
None
}
}
pub fn peek(&mut self) -> Option<u8> {
if self.refill_buffer() {
Some(self.buf[self.at])
} else {
None
}
}
pub fn skip_whitespace(&mut self) {
while let Some(b) = self.peek() {
if !char::from(b).is_whitespace() {
return;
}
self.get();
}
}
pub fn next_token(&mut self) -> Option<Vec<u8>> {
self.skip_whitespace();
let mut res = Vec::new();
while let Some(c) = self.get() {
if char::from(c).is_whitespace() {
break;
}
res.push(c);
}
if res.is_empty() {
None
} else {
Some(res)
}
}
//noinspection RsSelfConvention
pub fn is_exhausted(&mut self) -> bool {
self.peek().is_none()
}
pub fn has_more_elements(&mut self) -> bool {
!self.is_exhausted()
}
pub fn read<T: Readable>(&mut self) -> T {
T::read(self)
}
pub fn vec<T: Readable>(&mut self, size: usize) -> Vec<T> {
let mut res = Vec::with_capacity(size);
for _ in 0usize..size {
res.push(self.read());
}
res
}
pub fn string_vec(&mut self, size: usize) -> Vec<Vec<u8>> {
let mut res = Vec::with_capacity(size);
for _ in 0usize..size {
res.push(self.string());
}
res
}
pub fn read_line(&mut self) -> String {
let mut res = String::new();
while let Some(c) = self.get() {
if c == b'\n' {
break;
}
if c == b'\r' {
if self.peek() == Some(b'\n') {
self.get();
}
break;
}
res.push(c.into());
}
res
}
#[allow(clippy::should_implement_trait)]
pub fn into_iter<T: Readable>(self) -> InputIterator<T> {
InputIterator {
input: self,
phantom: Default::default(),
}
}
fn read_integer<T: FromStr + Debug>(&mut self) -> T
where
<T as FromStr>::Err: Debug,
{
let res = self.read_string();
res.parse::<T>().unwrap()
}
fn read_string(&mut self) -> String {
match self.next_token() {
None => {
panic!("Input exhausted");
}
Some(res) => unsafe { String::from_utf8_unchecked(res) },
}
}
pub fn string_as_string(&mut self) -> String {
self.read_string()
}
pub fn string(&mut self) -> Vec<u8> {
self.read_string().into_bytes()
}
fn read_char(&mut self) -> char {
self.skip_whitespace();
self.get().unwrap().into()
}
fn read_float(&mut self) -> f64 {
self.read_string().parse().unwrap()
}
pub fn f64(&mut self) -> f64 {
self.read_float()
}
fn refill_buffer(&mut self) -> bool {
if self.at == self.buf_read {
self.at = 0;
self.buf_read = self.input.read(&mut self.buf).unwrap();
self.buf_read != 0
} else {
true
}
}
read_integer_fun!(i32);
read_integer_fun!(i64);
read_integer_fun!(i128);
read_integer_fun!(u32);
read_integer_fun!(u64);
read_integer_fun!(usize);
}
pub trait Readable {
fn read(input: &mut Input) -> Self;
}
impl Readable for String {
fn read(input: &mut Input) -> Self {
input.read_string()
}
}
impl Readable for char {
fn read(input: &mut Input) -> Self {
input.read_char()
}
}
impl Readable for f64 {
fn read(input: &mut Input) -> Self {
input.read_string().parse().unwrap()
}
}
impl Readable for f32 {
fn read(input: &mut Input) -> Self {
input.read_string().parse().unwrap()
}
}
impl<T: Readable> Readable for Vec<T> {
fn read(input: &mut Input) -> Self {
let size = input.read();
input.vec(size)
}
}
pub struct InputIterator<T: Readable> {
input: Input,
phantom: PhantomData<T>,
}
impl<T: Readable> Iterator for InputIterator<T> {
type Item = T;
fn next(&mut self) -> Option<Self::Item> {
self.input.skip_whitespace();
self.input.peek().map(|_| self.input.read())
}
}
macro_rules! read_integer {
($t:ident) => {
impl Readable for $t {
fn read(input: &mut Input) -> Self {
input.read_integer()
}
}
};
}
read_integer!(i8);
read_integer!(i16);
read_integer!(i32);
read_integer!(i64);
read_integer!(i128);
read_integer!(isize);
read_integer!(u8);
read_integer!(u16);
read_integer!(u32);
read_integer!(u64);
read_integer!(u128);
read_integer!(usize);
}
pub mod output {
use std::io::Write;
pub struct Output {
output: Box<dyn Write>,
buf: Vec<u8>,
at: usize,
auto_flush: bool,
}
impl Output {
const DEFAULT_BUF_SIZE: usize = 4096;
pub fn new(output: Box<dyn Write>) -> Self {
Self {
output,
buf: vec![0; Self::DEFAULT_BUF_SIZE],
at: 0,
auto_flush: false,
}
}
pub fn new_stdout() -> Self {
let stdout = std::io::stdout();
Self::new(Box::new(stdout))
}
pub fn new_file(path: impl AsRef<std::path::Path>) -> Self {
let file = std::fs::File::create(path).unwrap();
Self::new(Box::new(file))
}
pub fn new_with_auto_flush(output: Box<dyn Write>) -> Self {
Self {
output,
buf: vec![0; Self::DEFAULT_BUF_SIZE],
at: 0,
auto_flush: true,
}
}
pub fn flush(&mut self) {
if self.at != 0 {
self.output.write_all(&self.buf[..self.at]).unwrap();
self.at = 0;
self.output.flush().expect("Couldn't flush output");
}
}
pub fn print<T: Writable>(&mut self, s: T) {
s.write(self);
}
pub fn println<T: Writable>(&mut self, s: T) {
s.write(self);
self.put(b'\n');
}
pub fn put(&mut self, b: u8) {
self.buf[self.at] = b;
self.at += 1;
if self.at == self.buf.len() {
self.flush();
}
}
pub fn maybe_flush(&mut self) {
if self.auto_flush {
self.flush();
}
}
pub fn print_per_line<T: Writable>(&mut self, arg: &[T]) {
for i in arg {
i.write(self);
self.put(b'\n');
}
}
pub fn print_iter<T: Writable, I: Iterator<Item = T>>(&mut self, iter: I) {
let mut first = true;
for e in iter {
if first {
first = false;
} else {
self.put(b' ');
}
e.write(self);
}
}
pub fn print_iter_ref<'a, T: 'a + Writable, I: Iterator<Item = &'a T>>(&mut self, iter: I) {
let mut first = true;
for e in iter {
if first {
first = false;
} else {
self.put(b' ');
}
e.write(self);
}
}
}
impl Write for Output {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
let mut start = 0usize;
let mut rem = buf.len();
while rem > 0 {
let len = (self.buf.len() - self.at).min(rem);
self.buf[self.at..self.at + len].copy_from_slice(&buf[start..start + len]);
self.at += len;
if self.at == self.buf.len() {
self.flush();
}
start += len;
rem -= len;
}
if self.auto_flush {
self.flush();
}
Ok(buf.len())
}
fn flush(&mut self) -> std::io::Result<()> {
self.flush();
Ok(())
}
}
pub trait Writable {
fn write(&self, output: &mut Output);
}
impl Writable for &str {
fn write(&self, output: &mut Output) {
output.write_all(self.as_bytes()).unwrap();
}
}
impl Writable for String {
fn write(&self, output: &mut Output) {
output.write_all(self.as_bytes()).unwrap();
}
}
impl Writable for char {
fn write(&self, output: &mut Output) {
output.put(*self as u8);
}
}
impl<T: Writable> Writable for [T] {
fn write(&self, output: &mut Output) {
output.print_iter_ref(self.iter());
}
}
impl<T: Writable> Writable for Vec<T> {
fn write(&self, output: &mut Output) {
self[..].write(output);
}
}
macro_rules! write_to_string {
($t:ident) => {
impl Writable for $t {
fn write(&self, output: &mut Output) {
self.to_string().write(output);
}
}
};
}
write_to_string!(u8);
write_to_string!(u16);
write_to_string!(u32);
write_to_string!(u64);
write_to_string!(u128);
write_to_string!(usize);
write_to_string!(i8);
write_to_string!(i16);
write_to_string!(i32);
write_to_string!(i64);
write_to_string!(i128);
write_to_string!(isize);
write_to_string!(f32);
write_to_string!(f64);
impl<T: Writable, U: Writable> Writable for (T, U) {
fn write(&self, output: &mut Output) {
self.0.write(output);
output.put(b' ');
self.1.write(output);
}
}
impl<T: Writable, U: Writable, V: Writable> Writable for (T, U, V) {
fn write(&self, output: &mut Output) {
self.0.write(output);
output.put(b' ');
self.1.write(output);
output.put(b' ');
self.2.write(output);
}
}
}
}
pub mod misc {
pub mod dbg_macro {
#[macro_export]
#[allow(unused_macros)]
macro_rules! dbg {
($first_val:expr, $($val:expr),+ $(,)?) => {
eprint!("[{}:{}] {} = {:?}",
file!(), line!(), stringify!($first_val), &$first_val);
($(eprint!(", {} = {:?}", stringify!($val), &$val)),+,);
eprintln!();
};
($first_val:expr) => {
eprintln!("[{}:{}] {} = {:?}",
file!(), line!(), stringify!($first_val), &$first_val)
};
}
}
}
}
fn main() {
let input = algo_lib::io::input::Input::new_stdin();
let mut output = algo_lib::io::output::Output::new_stdout();
crate::solution::run(input, output);
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 2096kb
input:
2 5 1 1 1 1 1 2 1 1 3 2 3 5 2 2 4 3 1 1 1 2 2 2 3 3 3
output:
0 0 2 5 5 0 3 3
result:
ok 8 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 2360kb
input:
16 1 1 1 1 2 1 1 1 1 1 100000 3 1 1 1 1 1 100000 1 100000 1 4 1 1 1 1 1 100000 1 100000 1 1 100000 100000 5 1 1 1 1 1 100000 1 100000 1 1 100000 100000 100000 1 1 6 1 1 1 1 1 100000 1 100000 1 1 100000 100000 100000 1 1 100000 1 100000 7 1 1 1 1 1 100000 1 100000 1 1 100000 100000 100000 1 1 100000 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 0 0 0 0 6 6 0 0 0 0 7 7 7 0 0 0 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 0 0 0 0 6 6 0 0 0 0 7 7 7 0 0 0 0 8 8 8 8
result:
ok 72 numbers
Test #3:
score: 0
Accepted
time: 61ms
memory: 2228kb
input:
10000 22 1 4 4 7 2 6 6 5 4 4 4 1 1 7 1 7 6 6 5 8 6 4 4 8 6 7 6 1 7 3 5 7 8 5 1 3 2 1 7 1 2 5 6 1 2 3 1 1 7 3 8 1 4 6 6 5 7 4 4 7 7 7 5 3 4 6 13 2 7 3 2 7 5 5 1 5 8 7 1 6 6 7 3 5 8 8 1 6 4 8 4 1 4 3 6 2 5 6 8 4 1 5 5 5 3 4 28 4 7 2 3 8 5 1 1 6 1 7 4 5 5 6 6 1 5 4 5 2 1 1 5 2 6 3 4 3 6 4 5 7 3 3 6 6 8...
output:
0 0 0 0 7 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 0 3 9 13 13 13 13 13 13 13 13 13 0 0 0 0 8 21 21 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 0 0 1 9 9 14 14 14 14 14 14 14 14 14 0 0 0 6 9 12 12 19 19 19 19 19 19 19 19 19 19 19 19 0 0 0 0 3 8 10 22 36 36 36 36 36 36 ...
result:
ok 199157 numbers
Test #4:
score: 0
Accepted
time: 76ms
memory: 2216kb
input:
10000 11 16 4 3 13 14 10 6 2 19 4 16 7 13 11 13 18 6 20 19 11 5 17 4 19 2 2 17 8 18 5 14 14 1 39 3 12 9 4 9 17 5 7 2 4 12 15 5 12 14 15 20 16 19 11 12 5 8 13 13 18 12 9 14 15 12 18 13 19 11 18 14 17 14 2 19 4 9 3 10 19 5 2 19 10 12 6 10 6 20 16 18 5 20 6 5 8 5 17 14 19 10 5 5 13 9 9 2 5 16 20 14 14 ...
output:
0 2 11 11 11 11 11 11 11 11 11 0 0 2 11 22 33 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 0 0 3 12 15 15 15 15 15 15 15 15 15 15 15 15 0 1 3 21 25 32 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38...
result:
ok 199593 numbers
Test #5:
score: 0
Accepted
time: 97ms
memory: 2248kb
input:
10000 22 40126 51309 54005 77536 83774 68530 35537 89229 39298 26549 72686 40526 72054 78714 67371 54406 93387 54598 62891 79741 7031 21699 38166 16961 98001 73695 16118 23105 44313 87949 61147 44816 82830 40866 30839 37096 63254 98489 15491 2724 410 12208 96504 21764 35334 777 98615 64141 98638 282...
output:
0 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 10 10 10 10 10 10 10 10 10 0 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 0 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26...
result:
ok 194828 numbers
Test #6:
score: 0
Accepted
time: 82ms
memory: 2164kb
input:
20000 13 2 7 2 11 1 15 7 11 11 14 3 2 8 4 2 14 13 3 1 3 9 1 9 6 10 5 9 3 6 14 11 3 2 10 10 2 4 14 8 18 7 1 7 15 6 14 10 4 2 9 11 6 12 3 2 6 12 4 14 14 8 15 6 4 9 12 1 14 4 6 3 5 13 15 1 5 5 7 3 14 7 14 6 13 5 15 15 5 3 13 5 5 4 13 17 12 12 9 10 12 9 6 11 4 15 1 14 6 3 15 6 6 10 6 8 3 15 5 9 12 6 7 1...
output:
0 3 7 8 8 13 13 13 13 13 13 13 13 0 0 7 12 18 18 18 18 18 18 18 18 18 18 18 18 18 18 0 0 5 6 17 17 17 17 17 17 17 17 17 17 17 17 17 0 0 3 0 1 5 5 5 0 2 8 15 15 15 15 15 15 15 15 15 15 15 15 0 1 6 9 9 9 9 9 9 0 0 5 17 17 17 17 17 17 17 17 17 17 17 17 17 17 0 1 5 5 5 0 2 0 0 0 13 16 16 16 16 16 16 16 ...
result:
ok 191387 numbers
Test #7:
score: 0
Accepted
time: 94ms
memory: 2156kb
input:
20000 2 69026 89423 26470 19943 3587 25231 9 96641 23438 60068 67211 19770 48041 15125 93974 46480 5771 64091 75193 17303 53889 28772 24105 87959 20685 14225 35987 93612 79842 79992 89652 81542 34986 15554 15 7463 88448 20014 74043 61063 90326 80812 97411 13843 38384 61124 37764 18186 80264 55309 12...
output:
0 2 0 9 9 9 9 9 9 9 9 0 15 15 15 15 15 15 15 15 15 15 15 15 15 15 0 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 0 7 7 7 7 7 7 0 8 8 8 8 8 8 8 0 13 13 13 13 13 13 13 13 13 13 13 13 0 4 4 4 0 3 3 0 3 3 0 5 5 5 5 0 2 0 2 0 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 0 3 3 0 13 13 13 13 13 13 13 13 13...
result:
ok 189019 numbers
Test #8:
score: 0
Accepted
time: 13ms
memory: 5408kb
input:
2 61322 15 48 50 13 48 35 41 1 39 4 4 46 13 46 39 48 43 8 37 28 42 47 6 18 15 27 25 11 34 45 33 28 9 33 37 15 40 16 26 13 10 22 10 41 17 21 22 8 37 31 48 11 48 29 1 45 49 26 28 3 35 20 36 17 42 40 42 45 36 49 32 28 46 37 5 35 50 49 30 36 32 17 35 11 38 49 27 25 7 21 41 7 3 25 48 9 4 17 13 12 30 23 3...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 64422 numbers
Test #9:
score: 0
Accepted
time: 91ms
memory: 24328kb
input:
2 82319 81784 15676 55428 36920 13434 44904 46877 92320 35269 44212 4490 14286 46939 25409 46324 66302 38351 14822 2554 1983 16106 23690 16816 73141 23210 66029 15099 93719 34782 576 22743 40722 70251 59272 25745 16644 50442 3167 5358 42914 48423 52435 546 35826 2467 42278 59162 52914 56020 16044 76...
output:
0 6924 42079 70072 79822 81906 82247 82310 82310 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319 82319...
result:
ok 130773 numbers
Test #10:
score: 0
Accepted
time: 212ms
memory: 46564kb
input:
2 100000 95821 95821 95821 54965 54965 54965 63811 63811 63811 11219 11219 11219 27274 27274 27274 76752 76752 76752 70949 70949 70949 59746 59746 59746 84495 84495 84495 60363 60363 60363 93707 93707 93707 91384 91384 91384 81227 81227 81227 13202 13202 13202 80413 80413 80413 67024 67024 67024 955...
output:
0 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 1000...
result:
ok 200000 numbers
Test #11:
score: 0
Accepted
time: 81ms
memory: 17552kb
input:
2 100000 95821 100000 100000 54965 100000 100000 63811 100000 100000 11219 100000 100000 27274 100000 100000 76752 100000 100000 70949 100000 100000 59746 100000 100000 84495 100000 100000 60363 100000 100000 93707 100000 100000 91384 100000 100000 81227 100000 100000 13202 100000 100000 80413 10000...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 200000 numbers
Test #12:
score: 0
Accepted
time: 64ms
memory: 12460kb
input:
2 100000 15607 10014 1 15607 9262 14 15607 9234 10 15607 8689 1 15607 9029 4 14951 6967 16 29294 6967 6 15607 7733 8 18137 6967 6 4732 6967 2 15607 3881 13 16779 6967 6 15607 8967 1 9472 6967 11 7513 6967 2 14262 6967 2 15607 10174 4 15607 14425 1 15607 11464 10 15607 7552 20 13620 6967 2 15117 6967...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 200000 numbers
Test #13:
score: 0
Accepted
time: 41ms
memory: 7348kb
input:
2 100000 2150 1762 156 2597 1769 155 2150 2164 41 2150 1645 200 2940 1769 232 2150 2357 244 2150 2542 211 2150 1602 200 3800 1769 68 1988 1769 35 2150 1476 291 1934 1769 161 2150 2330 129 2854 1769 121 2150 1741 156 2150 1832 37 2040 1769 271 1954 1769 53 2135 1769 220 2150 1993 43 2018 1769 144 215...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 200000 numbers
Test #14:
score: 0
Accepted
time: 59ms
memory: 11016kb
input:
2 100000 2 2 20043 2 1 46314 3 2 35997 2 2 187 3 2 2659 2 2 30453 2 3 35736 2 2 42562 2 2 45524 2 2 18450 2 2 46079 2 1 48534 2 2 9224 2 2 25209 1 2 26067 1 2 47241 2 1 38187 2 3 13413 2 3 5436 3 2 25393 2 1 16032 2 1 11613 2 1 13527 2 1 1691 2 2 11078 2 2 42812 2 2 15877 2 2 31491 2 3 42954 2 2 315...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 200000 numbers
Test #15:
score: 0
Accepted
time: 36ms
memory: 7472kb
input:
2 99235 437 669 437 189 213 189 404 634 404 327 608 327 243 342 243 122 128 122 431 582 431 433 839 433 302 414 302 375 648 375 419 758 419 53 83 53 291 476 291 157 259 157 326 609 326 199 237 199 192 278 192 430 786 430 223 420 223 233 393 233 349 478 349 414 432 414 82 101 82 118 191 118 236 412 2...
output:
0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190 210 231 253 276 300 325 351 378 406 435 465 496 528 561 595 630 666 703 741 780 820 861 903 946 990 1035 1081 1128 1176 1225 1275 1326 1378 1431 1485 1540 1596 1653 1711 1770 1830 1891 1953 2016 2080 2145 2211 2278 2346 2415 2485 2556 262...
result:
ok 198470 numbers
Test #16:
score: 0
Accepted
time: 88ms
memory: 19660kb
input:
2 100000 80563 80563 97252 12843 12843 19316 12843 12843 16382 44624 44624 46497 60814 60814 63977 60814 60814 71202 30582 30582 32221 30582 30582 32531 60814 60814 75724 44624 44624 51465 30582 30582 35921 4002 4002 9752 12843 12843 15363 80563 80563 96382 60814 60814 63381 79534 76436 76436 60814 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 200000 numbers
Test #17:
score: 0
Accepted
time: 100ms
memory: 20908kb
input:
2 100000 87516 87516 87624 89008 89008 89031 23379 23457 23379 44799 44799 44841 57419 57419 57510 61889 61889 61996 4521 4482 4482 46081 46062 46062 51673 51399 51399 18489 18512 18489 92503 92625 92503 28615 28547 28547 39770 39770 39833 7066 7827 7066 27547 27496 27496 9503 9503 9520 58144 58192 ...
output:
0 7 23 44 76 141 177 268 332 440 550 649 805 870 968 1163 1419 1538 1736 1907 2087 2402 2578 2647 2719 2894 2998 3160 3328 3473 3563 3749 4101 4266 4538 4818 5034 5589 5893 6088 6368 6614 6908 7037 7301 7571 8031 8360 8696 9235 9535 9892 10308 10520 10952 11502 11950 12292 12350 12586 12766 12949 13...
result:
ok 200000 numbers
Test #18:
score: 0
Accepted
time: 100ms
memory: 24160kb
input:
2 100000 1 1 1 2 2 1 3 3 1 4 4 1 5 5 1 6 6 1 7 7 1 8 8 1 9 9 1 10 10 1 11 11 1 12 12 1 13 13 1 14 14 1 15 15 1 16 16 1 17 17 1 18 18 1 19 19 1 20 20 1 21 21 1 22 22 1 23 23 1 24 24 1 25 25 1 26 26 1 27 27 1 28 28 1 29 29 1 30 30 1 31 31 1 32 32 1 33 33 1 34 34 1 35 35 1 36 36 1 37 37 1 38 38 1 39 39...
output:
0 0 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50000 50...
result:
ok 200000 numbers
Test #19:
score: 0
Accepted
time: 108ms
memory: 22216kb
input:
2 100000 82319 81784 15676 82319 55428 36920 82319 13434 44904 82319 46877 92320 82319 35269 44212 82319 4490 14286 82319 46939 25409 82319 46324 66302 82319 38351 14822 82319 2554 1983 82319 16106 23690 82319 16816 73141 82319 23210 66029 82319 15099 93719 82319 34782 576 82319 22743 40722 82319 70...
output:
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 200000 numbers
Extra Test:
score: 0
Extra Test Passed