QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#273078 | #7879. Colorful Balloons | ucup-team296# | AC ✓ | 23ms | 16460kb | Rust | 25.0kb | 2023-12-02 21:07:37 | 2023-12-02 21:07:38 |
Judging History
answer
//
pub mod solution {
use crate::collections::default_map::default_hash_map::DefaultHashMap;
use crate::io::input::Input;
use crate::io::output::Output;
use crate::string::str::StrReader;
type PreCalc = ();
fn solve(input: &mut Input, out: &mut Output, _test_case: usize, _data: &PreCalc) {
let n = input.read_size();
let s = input.read_str_vec(n);
let mut map = DefaultHashMap::<_, usize>::new();
for s in s {
map[s] += 1;
}
for (k, v) in map {
if 2 * v > n {
out.print_line(k);
return;
}
}
out.print_line("uh-oh");
}
pub(crate) fn run(mut input: Input, mut output: Output) -> bool {
let pre_calc = ();
#[allow(dead_code)]
enum TestType {
Single,
MultiNumber,
MultiEof,
}
let test_type = TestType::Single;
match test_type {
TestType::Single => solve(&mut input, &mut output, 1, &pre_calc),
TestType::MultiNumber => {
let t = input.read();
for i in 1..=t {
solve(&mut input, &mut output, i, &pre_calc);
}
}
TestType::MultiEof => {
let mut i = 1;
while input.peek().is_some() {
solve(&mut input, &mut output, i, &pre_calc);
i += 1;
}
}
}
output.flush();
input.skip_whitespace();
input.peek().is_none()
}
}
pub mod collections {
pub mod default_map {
pub mod default_hash_map {
use std::collections::HashMap;
use std::hash::Hash;
use std::iter::FromIterator;
use std::ops::{Deref, DerefMut, Index, IndexMut};
#[derive(Default, Clone, Eq, PartialEq)]
pub struct DefaultHashMap<K: Hash + Eq, V>(HashMap<K, V>, V);
impl<K: Hash + Eq, V> Deref for DefaultHashMap<K, V> {
type Target = HashMap<K, V>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<K: Hash + Eq, V> DerefMut for DefaultHashMap<K, V> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<K: Hash + Eq, V: Default> DefaultHashMap<K, V> {
pub fn new() -> Self {
Self(HashMap::new(), V::default())
}
pub fn with_capacity(cap: usize) -> Self {
Self(HashMap::with_capacity(cap), V::default())
}
pub fn get(&self, key: &K) -> &V {
self.0.get(key).unwrap_or(&self.1)
}
pub fn get_mut(&mut self, key: K) -> &mut V {
self.0.entry(key).or_insert_with(|| V::default())
}
pub fn into_values(self) -> std::collections::hash_map::IntoValues<K, V> {
self.0.into_values()
}
}
impl<K: Hash + Eq, V: Default> Index<K> for DefaultHashMap<K, V> {
type Output = V;
fn index(&self, index: K) -> &Self::Output {
self.get(&index)
}
}
impl<K: Hash + Eq, V: Default> IndexMut<K> for DefaultHashMap<K, V> {
fn index_mut(&mut self, index: K) -> &mut Self::Output {
self.get_mut(index)
}
}
impl<K: Hash + Eq, V> IntoIterator for DefaultHashMap<K, V> {
type Item = (K, V);
type IntoIter = std::collections::hash_map::IntoIter<K, V>;
fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}
impl<K: Hash + Eq, V: Default> FromIterator<(K, V)> for DefaultHashMap<K, V> {
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self {
Self(iter.into_iter().collect(), V::default())
}
}
}
}
pub mod iter_ext {
pub mod collect {
pub trait IterCollect<T>: Iterator<Item = T> + Sized {
fn collect_vec(self) -> Vec<T> {
self.collect()
}
}
impl<T, I: Iterator<Item = T> + Sized> IterCollect<T> for I {}
}
}
pub mod vec_ext {
pub mod default {
pub fn default_vec<T: Default>(len: usize) -> Vec<T> {
let mut v = Vec::with_capacity(len);
for _ in 0..len {
v.push(T::default());
}
v
}
}
}
}
pub mod io {
pub mod input {
use crate::collections::vec_ext::default::default_vec;
use std::io::Read;
pub struct Input<'s> {
input: &'s mut dyn Read,
buf: Vec<u8>,
at: usize,
buf_read: usize,
}
macro_rules! read_impl {
($t: ty, $read_name: ident, $read_vec_name: ident) => {
pub fn $read_name(&mut self) -> $t {
self.read()
}
pub fn $read_vec_name(&mut self, len: usize) -> Vec<$t> {
self.read_vec(len)
}
};
($t: ty, $read_name: ident, $read_vec_name: ident, $read_pair_vec_name: ident) => {
read_impl!($t, $read_name, $read_vec_name);
pub fn $read_pair_vec_name(&mut self, len: usize) -> Vec<($t, $t)> {
self.read_vec(len)
}
};
}
impl<'s> Input<'s> {
const DEFAULT_BUF_SIZE: usize = 4096;
pub fn new(input: &'s mut dyn Read) -> Self {
Self {
input,
buf: default_vec(Self::DEFAULT_BUF_SIZE),
at: 0,
buf_read: 0,
}
}
pub fn new_with_size(input: &'s mut dyn Read, buf_size: usize) -> Self {
Self {
input,
buf: default_vec(buf_size),
at: 0,
buf_read: 0,
}
}
pub fn get(&mut self) -> Option<u8> {
if self.refill_buffer() {
let res = self.buf[self.at];
self.at += 1;
if res == b'\r' {
if self.refill_buffer() && self.buf[self.at] == b'\n' {
self.at += 1;
}
return Some(b'\n');
}
Some(res)
} else {
None
}
}
pub fn peek(&mut self) -> Option<u8> {
if self.refill_buffer() {
let res = self.buf[self.at];
Some(if res == b'\r' { b'\n' } else { res })
} 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 read<T: Readable>(&mut self) -> T {
T::read(self)
}
pub fn read_vec<T: Readable>(&mut self, size: usize) -> Vec<T> {
let mut res = Vec::with_capacity(size);
for _ in 0..size {
res.push(self.read());
}
res
}
pub fn read_char(&mut self) -> char {
self.skip_whitespace();
self.get().unwrap().into()
}
read_impl!(u32, read_unsigned, read_unsigned_vec);
read_impl!(u64, read_u64, read_u64_vec);
read_impl!(usize, read_size, read_size_vec, read_size_pair_vec);
read_impl!(i32, read_int, read_int_vec, read_int_pair_vec);
read_impl!(i64, read_long, read_long_vec, read_long_pair_vec);
read_impl!(i128, read_i128, read_i128_vec);
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
}
}
}
pub trait Readable {
fn read(input: &mut Input) -> Self;
}
impl Readable for char {
fn read(input: &mut Input) -> Self {
input.read_char()
}
}
impl<T: Readable> Readable for Vec<T> {
fn read(input: &mut Input) -> Self {
let size = input.read();
input.read_vec(size)
}
}
macro_rules! read_integer {
($($t:ident)+) => {$(
impl Readable for $t {
fn read(input: &mut Input) -> Self {
input.skip_whitespace();
let mut c = input.get().unwrap();
let sgn = match c {
b'-' => {
c = input.get().unwrap();
true
}
b'+' => {
c = input.get().unwrap();
false
}
_ => false,
};
let mut res = 0;
loop {
assert!(c.is_ascii_digit());
res *= 10;
let d = (c - b'0') as $t;
if sgn {
res -= d;
} else {
res += d;
}
match input.get() {
None => break,
Some(ch) => {
if ch.is_ascii_whitespace() {
break;
} else {
c = ch;
}
}
}
}
res
}
}
)+};
}
read_integer!(i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize);
macro_rules! tuple_readable {
($($name:ident)+) => {
impl<$($name: Readable), +> Readable for ($($name,)+) {
fn read(input: &mut Input) -> Self {
($($name::read(input),)+)
}
}
}
}
tuple_readable! {T}
tuple_readable! {T U}
tuple_readable! {T U V}
tuple_readable! {T U V X}
tuple_readable! {T U V X Y}
tuple_readable! {T U V X Y Z}
tuple_readable! {T U V X Y Z A}
tuple_readable! {T U V X Y Z A B}
tuple_readable! {T U V X Y Z A B C}
tuple_readable! {T U V X Y Z A B C D}
tuple_readable! {T U V X Y Z A B C D E}
tuple_readable! {T U V X Y Z A B C D E F}
impl Read for Input<'_> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
if self.at == self.buf_read {
self.input.read(buf)
} else {
let mut i = 0;
while i < buf.len() && self.at < self.buf_read {
buf[i] = self.buf[self.at];
i += 1;
self.at += 1;
}
Ok(i)
}
}
}
}
pub mod output {
use crate::collections::vec_ext::default::default_vec;
use std::io::{stderr, Stderr, Write};
#[derive(Copy, Clone)]
pub enum BoolOutput {
YesNo,
YesNoCaps,
PossibleImpossible,
Custom(&'static str, &'static str),
}
impl BoolOutput {
pub fn output(&self, output: &mut Output, val: bool) {
(if val { self.yes() } else { self.no() }).write(output);
}
fn yes(&self) -> &str {
match self {
BoolOutput::YesNo => "Yes",
BoolOutput::YesNoCaps => "YES",
BoolOutput::PossibleImpossible => "Possible",
BoolOutput::Custom(yes, _) => yes,
}
}
fn no(&self) -> &str {
match self {
BoolOutput::YesNo => "No",
BoolOutput::YesNoCaps => "NO",
BoolOutput::PossibleImpossible => "Impossible",
BoolOutput::Custom(_, no) => no,
}
}
}
pub struct Output<'s> {
output: &'s mut dyn Write,
buf: Vec<u8>,
at: usize,
auto_flush: bool,
bool_output: BoolOutput,
}
impl<'s> Output<'s> {
const DEFAULT_BUF_SIZE: usize = 4096;
pub fn new(output: &'s mut dyn Write) -> Self {
Self {
output,
buf: default_vec(Self::DEFAULT_BUF_SIZE),
at: 0,
auto_flush: false,
bool_output: BoolOutput::YesNoCaps,
}
}
pub fn new_with_auto_flush(output: &'s mut dyn Write) -> Self {
Self {
output,
buf: default_vec(Self::DEFAULT_BUF_SIZE),
at: 0,
auto_flush: true,
bool_output: BoolOutput::YesNoCaps,
}
}
pub fn flush(&mut self) {
if self.at != 0 {
self.output.write_all(&self.buf[..self.at]).unwrap();
self.output.flush().unwrap();
self.at = 0;
}
}
pub fn print<T: Writable>(&mut self, s: T) {
s.write(self);
self.maybe_flush();
}
pub fn print_line<T: Writable>(&mut self, s: T) {
self.print(s);
self.put(b'\n');
self.maybe_flush();
}
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);
}
}
pub fn set_bool_output(&mut self, bool_output: BoolOutput) {
self.bool_output = bool_output;
}
}
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;
}
self.maybe_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, const N: usize> Writable for [T; N] {
fn write(&self, output: &mut Output) {
output.print_iter_ref(self.iter());
}
}
impl<T: Writable> Writable for &T {
fn write(&self, output: &mut Output) {
T::write(self, output)
}
}
impl<T: Writable> Writable for Vec<T> {
fn write(&self, output: &mut Output) {
self.as_slice().write(output);
}
}
impl Writable for () {
fn write(&self, _output: &mut 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 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize);
macro_rules! tuple_writable {
($name0:ident $($name:ident: $id:tt )*) => {
impl<$name0: Writable, $($name: Writable,)*> Writable for ($name0, $($name,)*) {
fn write(&self, out: &mut Output) {
self.0.write(out);
$(
out.put(b' ');
self.$id.write(out);
)*
}
}
}
}
tuple_writable! {T}
tuple_writable! {T U:1}
tuple_writable! {T U:1 V:2}
tuple_writable! {T U:1 V:2 X:3}
tuple_writable! {T U:1 V:2 X:3 Y:4}
tuple_writable! {T U:1 V:2 X:3 Y:4 Z:5}
tuple_writable! {T U:1 V:2 X:3 Y:4 Z:5 A:6}
tuple_writable! {T U:1 V:2 X:3 Y:4 Z:5 A:6 B:7}
impl<T: Writable> Writable for Option<T> {
fn write(&self, output: &mut Output) {
match self {
None => (-1).write(output),
Some(t) => t.write(output),
}
}
}
impl Writable for bool {
fn write(&self, output: &mut Output) {
let bool_output = output.bool_output;
bool_output.output(output, *self)
}
}
static mut ERR: Option<Stderr> = None;
pub fn err() -> Output<'static> {
unsafe {
if ERR.is_none() {
ERR = Some(stderr());
}
Output::new_with_auto_flush(ERR.as_mut().unwrap())
}
}
}
}
pub mod string {
pub mod str {
use crate::collections::iter_ext::collect::IterCollect;
use crate::io::input::{Input, Readable};
use crate::io::output::{Output, Writable};
use std::cmp::Ordering;
use std::fmt::{Display, Formatter};
use std::hash::{Hash, Hasher};
use std::iter::{Copied, FromIterator};
use std::marker::PhantomData;
use std::ops::{Add, AddAssign, Deref, DerefMut, Index, IndexMut};
use std::slice::{Iter, IterMut, SliceIndex};
use std::vec::IntoIter;
pub enum Str<'s> {
Extendable(Vec<u8>, PhantomData<&'s [u8]>),
Owned(Box<[u8]>, PhantomData<&'s [u8]>),
Ref(&'s [u8]),
}
impl Default for Str<'static> {
fn default() -> Self {
Self::new()
}
}
impl Str<'static> {
pub fn new() -> Self {
Str::Extendable(Vec::new(), PhantomData)
}
pub fn with_capacity(cap: usize) -> Self {
Str::Extendable(Vec::with_capacity(cap), PhantomData)
}
}
impl<'s> Str<'s> {
pub fn push(&mut self, c: u8) {
self.transform_to_extendable();
self.as_extendable().push(c)
}
pub fn as_slice(&self) -> &[u8] {
match self {
Str::Extendable(s, _) => s.as_ref(),
Str::Owned(s, _) => s.as_ref(),
Str::Ref(s) => s,
}
}
pub fn len(&self) -> usize {
self.as_slice().len()
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
pub fn iter(&self) -> Copied<Iter<u8>> {
match self {
Str::Extendable(v, _) => v.iter(),
Str::Owned(v, _) => v.iter(),
Str::Ref(v) => v.iter(),
}
.copied()
}
pub fn iter_mut(&mut self) -> IterMut<u8> {
self.transform_to_owned();
self.as_mut_slice().iter_mut()
}
pub fn sort(&mut self) {
self.transform_to_owned();
self.as_mut_slice().sort_unstable();
}
pub fn into_owned(mut self) -> Str<'static> {
self.transform_to_owned();
match self {
Str::Extendable(v, _) => Str::Extendable(v, PhantomData),
Str::Owned(v, _) => Str::Owned(v, PhantomData),
_ => unreachable!(),
}
}
fn transform_to_extendable(&mut self) {
match self {
Str::Extendable(_, _) => {}
Str::Owned(_, _) => {
let mut fake = Str::new();
std::mem::swap(self, &mut fake);
if let Str::Owned(s, _) = fake {
*self = Str::Extendable(s.to_vec(), PhantomData)
}
}
Str::Ref(s) => *self = Str::Extendable(s.to_vec(), PhantomData),
}
}
fn as_extendable(&mut self) -> &mut Vec<u8> {
match self {
Str::Extendable(s, _) => s,
_ => panic!("unreachable"),
}
}
fn transform_to_owned(&mut self) {
if let Str::Ref(s) = self {
*self = Str::Owned(s.to_vec().into_boxed_slice(), PhantomData)
}
}
pub fn as_mut_slice(&mut self) -> &mut [u8] {
match self {
Str::Extendable(s, _) => s.as_mut_slice(),
Str::Owned(s, _) => s.as_mut(),
_ => panic!("unreachable"),
}
}
pub fn into_string(self) -> String {
match self {
Str::Extendable(v, _) => unsafe { String::from_utf8_unchecked(v) },
Str::Owned(v, _) => unsafe { String::from_utf8_unchecked(v.into_vec()) },
Str::Ref(v) => String::from_utf8_lossy(v).into_owned(),
}
}
pub fn reverse(&mut self) {
self.as_mut_slice().reverse();
}
pub fn trim(&self) -> &[u8] {
let mut start = 0;
let mut end = self.len();
while start < end && (self[start] as char).is_whitespace() {
start += 1;
}
while start < end && (self[end - 1] as char).is_whitespace() {
end -= 1;
}
&self[start..end]
}
}
impl<'s> IntoIterator for Str<'s> {
type Item = u8;
type IntoIter = IntoIter<u8>;
#[allow(clippy::unnecessary_to_owned)]
fn into_iter(self) -> Self::IntoIter {
match self {
Str::Extendable(v, _) => v.into_iter(),
Str::Owned(v, _) => v.into_vec().into_iter(),
Str::Ref(v) => v.to_vec().into_iter(),
}
}
}
impl From<String> for Str<'static> {
fn from(s: String) -> Self {
Str::Extendable(s.into(), PhantomData)
}
}
impl<'s> From<&'s str> for Str<'s> {
fn from(s: &'s str) -> Self {
Str::Ref(s.as_bytes())
}
}
impl From<Vec<u8>> for Str<'static> {
fn from(s: Vec<u8>) -> Self {
Str::Extendable(s, PhantomData)
}
}
impl<'s> From<&'s [u8]> for Str<'s> {
fn from(s: &'s [u8]) -> Self {
Str::Ref(s)
}
}
impl<'s> From<&'s String> for Str<'s> {
fn from(s: &'s String) -> Self {
Str::Ref(s.as_bytes())
}
}
impl<'s> From<&'s Vec<u8>> for Str<'s> {
fn from(s: &'s Vec<u8>) -> Self {
Str::Ref(s.as_slice())
}
}
impl From<u8> for Str<'static> {
fn from(c: u8) -> Self {
Str::Owned(Box::new([c]), PhantomData)
}
}
impl<R: SliceIndex<[u8]>> Index<R> for Str<'_> {
type Output = R::Output;
fn index(&self, index: R) -> &Self::Output {
self.as_slice().index(index)
}
}
impl<R: SliceIndex<[u8]>> IndexMut<R> for Str<'_> {
fn index_mut(&mut self, index: R) -> &mut Self::Output {
self.transform_to_owned();
self.as_mut_slice().index_mut(index)
}
}
impl Clone for Str<'_> {
fn clone(&self) -> Self {
match self {
Str::Extendable(s, _) => s.clone().into(),
Str::Owned(s, _) => s.to_vec().into(),
Str::Ref(s) => Str::Ref(s),
}
}
}
impl<'r, 's, S: Into<Str<'r>>> AddAssign<S> for Str<'s> {
fn add_assign(&mut self, rhs: S) {
self.transform_to_extendable();
self.as_extendable()
.extend_from_slice(rhs.into().as_slice());
}
}
impl<'r, 's, S: Into<Str<'r>>> Add<S> for Str<'s> {
type Output = Str<'s>;
fn add(mut self, rhs: S) -> Self::Output {
self += rhs;
self
}
}
impl Readable for Str<'static> {
fn read(input: &mut Input) -> Self {
input.next_token().unwrap().into()
}
}
impl Writable for Str<'_> {
fn write(&self, output: &mut Output) {
for c in self.as_slice() {
output.put(*c);
}
output.maybe_flush();
}
}
impl Display for Str<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
<String as Display>::fmt(&String::from_utf8(self.as_slice().to_vec()).unwrap(), f)
}
}
impl Hash for Str<'_> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.as_slice().hash(state);
}
}
impl<'r> PartialEq<Str<'r>> for Str<'_> {
fn eq(&self, other: &Str<'r>) -> bool {
self.as_slice().eq(other.as_slice())
}
}
impl Eq for Str<'_> {}
impl<'r> PartialOrd<Str<'r>> for Str<'_> {
fn partial_cmp(&self, other: &Str<'r>) -> Option<Ordering> {
self.as_slice().partial_cmp(other.as_slice())
}
}
impl Ord for Str<'_> {
fn cmp(&self, other: &Self) -> Ordering {
self.as_slice().cmp(other.as_slice())
}
}
impl FromIterator<u8> for Str<'static> {
fn from_iter<T: IntoIterator<Item = u8>>(iter: T) -> Self {
Self::Extendable(iter.into_iter().collect_vec(), Default::default())
}
}
impl<'r> FromIterator<&'r u8> for Str<'static> {
fn from_iter<T: IntoIterator<Item = &'r u8>>(iter: T) -> Self {
Self::Extendable(iter.into_iter().cloned().collect_vec(), Default::default())
}
}
impl Deref for Str<'_> {
type Target = [u8];
fn deref(&self) -> &Self::Target {
self.as_slice()
}
}
impl DerefMut for Str<'_> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.as_mut_slice()
}
}
pub trait StrReader {
fn read_str(&mut self) -> Str<'static>;
fn read_str_vec(&mut self, n: usize) -> Vec<Str<'static>>;
fn read_line(&mut self) -> Str<'static>;
}
impl StrReader for Input<'_> {
fn read_str(&mut self) -> Str<'static> {
self.read()
}
fn read_str_vec(&mut self, n: usize) -> Vec<Str<'static>> {
self.read_vec(n)
}
fn read_line(&mut self) -> Str<'static> {
let mut res = Str::new();
while let Some(c) = self.get() {
if c == b'\n' {
break;
}
res.push(c);
}
res
}
}
}
}
fn main() {
let mut sin = std::io::stdin();
let input = if false {
io::input::Input::new_with_size(&mut sin, 1)
} else {
io::input::Input::new(&mut sin)
};
let mut stdout = std::io::stdout();
let output = if false {
io::output::Output::new_with_auto_flush(&mut stdout)
} else {
io::output::Output::new(&mut stdout)
};
solution::run(input, output);
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 2136kb
input:
5 red green red red blue
output:
red
result:
ok "red"
Test #2:
score: 0
Accepted
time: 0ms
memory: 2256kb
input:
3 red blue yellow
output:
uh-oh
result:
ok "uh-oh"
Test #3:
score: 0
Accepted
time: 0ms
memory: 2092kb
input:
1 abc
output:
abc
result:
ok "abc"
Test #4:
score: 0
Accepted
time: 12ms
memory: 8212kb
input:
100000 vagsmrnnry vagsmrnnry bvaojtyvmn vagsmrnnry vagsmrnnry vvzrbrqrgb vagsmrnnry vvzrbrqrgb vagsmrnnry vagsmrnnry bvaojtyvmn vagsmrnnry vagsmrnnry vvzrbrqrgb vagsmrnnry bvaojtyvmn vagsmrnnry vagsmrnnry vagsmrnnry vvzrbrqrgb vagsmrnnry vvzrbrqrgb vagsmrnnry vagsmrnnry vagsmrnnry vagsmrnnry vagsmrn...
output:
vagsmrnnry
result:
ok "vagsmrnnry"
Test #5:
score: 0
Accepted
time: 6ms
memory: 8324kb
input:
100000 khccohwxsc aakazkvryg khccohwxsc aakazkvryg khccohwxsc khccohwxsc aakazkvryg aakazkvryg khccohwxsc djckwpxwyt khccohwxsc khccohwxsc djckwpxwyt khccohwxsc aakazkvryg djckwpxwyt djckwpxwyt djckwpxwyt aakazkvryg djckwpxwyt aakazkvryg aakazkvryg khccohwxsc aakazkvryg khccohwxsc aakazkvryg aakazkv...
output:
uh-oh
result:
ok "uh-oh"
Test #6:
score: 0
Accepted
time: 8ms
memory: 8208kb
input:
100000 zvdnbaaefc ygwmnasolc ygwmnasolc zvdnbaaefc ygwmnasolc ygwmnasolc ygwmnasolc zvdnbaaefc ygwmnasolc lrvdhogehr zvdnbaaefc lrvdhogehr zvdnbaaefc ygwmnasolc zvdnbaaefc lrvdhogehr ygwmnasolc lrvdhogehr lrvdhogehr ygwmnasolc zvdnbaaefc lrvdhogehr ygwmnasolc zvdnbaaefc lrvdhogehr ygwmnasolc zvdnbaa...
output:
uh-oh
result:
ok "uh-oh"
Test #7:
score: 0
Accepted
time: 8ms
memory: 8412kb
input:
100000 phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrhltc phgzqrh...
output:
phgzqrhltc
result:
ok "phgzqrhltc"
Test #8:
score: 0
Accepted
time: 12ms
memory: 8140kb
input:
100000 ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoelyvuh ahkoely...
output:
ahkoelyvuh
result:
ok "ahkoelyvuh"
Test #9:
score: 0
Accepted
time: 8ms
memory: 8156kb
input:
100000 o o o o zhtga o zhtga j zhtga j o zhtga o j zhtga zhtga o zhtga zhtga j o zhtga zhtga o o zhtga j j j j zhtga o o zhtga j o o o o j o o zhtga j o j o zhtga o o j o zhtga zhtga o o zhtga j o zhtga j zhtga zhtga o zhtga o o j o o o o j zhtga o zhtga zhtga j o o j o zhtga o zhtga zhtga o j o zht...
output:
o
result:
ok "o"
Test #10:
score: 0
Accepted
time: 11ms
memory: 8152kb
input:
100000 ofhyqmlxm ofhyqmlxm bjqjepbvf ofhyqmlxm ofhyqmlxm bjqjepbvf ofhyqmlxm bjqjepbvf ofhyqmlxm odzv ofhyqmlxm odzv ofhyqmlxm odzv odzv bjqjepbvf bjqjepbvf ofhyqmlxm ofhyqmlxm odzv ofhyqmlxm bjqjepbvf bjqjepbvf ofhyqmlxm bjqjepbvf ofhyqmlxm ofhyqmlxm ofhyqmlxm ofhyqmlxm ofhyqmlxm ofhyqmlxm odzv ofh...
output:
uh-oh
result:
ok "uh-oh"
Test #11:
score: 0
Accepted
time: 11ms
memory: 8208kb
input:
100000 yyojlg yyojlg ppontiloo zewczen ppontiloo ppontiloo zewczen zewczen yyojlg yyojlg yyojlg yyojlg yyojlg ppontiloo yyojlg zewczen ppontiloo ppontiloo ppontiloo ppontiloo yyojlg zewczen zewczen ppontiloo yyojlg ppontiloo ppontiloo ppontiloo ppontiloo ppontiloo yyojlg yyojlg yyojlg zewczen yyojlg...
output:
uh-oh
result:
ok "uh-oh"
Test #12:
score: 0
Accepted
time: 8ms
memory: 8320kb
input:
100000 hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi hmfgi...
output:
hmfgi
result:
ok "hmfgi"
Test #13:
score: 0
Accepted
time: 3ms
memory: 8380kb
input:
100000 a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a...
output:
a
result:
ok "a"
Test #14:
score: 0
Accepted
time: 8ms
memory: 8204kb
input:
100000 avxrabtazp guhogkqh xokfiolzw xokfiolzw guhogkqh avxrabtazp guhogkqh guhogkqh xokfiolzw xokfiolzw avxrabtazp xokfiolzw xokfiolzw xokfiolzw avxrabtazp xokfiolzw guhogkqh guhogkqh guhogkqh avxrabtazp guhogkqh guhogkqh xokfiolzw xokfiolzw guhogkqh xokfiolzw xokfiolzw guhogkqh xokfiolzw xokfiolzw...
output:
xokfiolzw
result:
ok "xokfiolzw"
Test #15:
score: 0
Accepted
time: 8ms
memory: 8372kb
input:
100000 bfmkgigain uldlsgwpyq uldlsgwpyq bfmkgigain uldlsgwpyq unpjxuczw bfmkgigain unpjxuczw bfmkgigain bfmkgigain uldlsgwpyq bfmkgigain bfmkgigain uldlsgwpyq unpjxuczw bfmkgigain unpjxuczw bfmkgigain unpjxuczw unpjxuczw bfmkgigain bfmkgigain unpjxuczw unpjxuczw unpjxuczw bfmkgigain bfmkgigain bfmkg...
output:
uh-oh
result:
ok "uh-oh"
Test #16:
score: 0
Accepted
time: 8ms
memory: 8360kb
input:
100000 kcaiebcxhl dqzbkpudon dqzbkpudon kcaiebcxhl kcaiebcxhl kcaiebcxhl kcaiebcxhl dqzbkpudon dqzbkpudon dqzbkpudon kcaiebcxhl dwwgjrgk dwwgjrgk dqzbkpudon dwwgjrgk dwwgjrgk dqzbkpudon dwwgjrgk dqzbkpudon dwwgjrgk dwwgjrgk dqzbkpudon kcaiebcxhl dwwgjrgk kcaiebcxhl dwwgjrgk kcaiebcxhl dqzbkpudon dqz...
output:
uh-oh
result:
ok "uh-oh"
Test #17:
score: 0
Accepted
time: 11ms
memory: 8192kb
input:
100000 ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebmtqvgdu ebm...
output:
ebmtqvgdu
result:
ok "ebmtqvgdu"
Test #18:
score: 0
Accepted
time: 9ms
memory: 8276kb
input:
100000 fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsadsqnv fljsads...
output:
fljsadsqnv
result:
ok "fljsadsqnv"
Test #19:
score: 0
Accepted
time: 8ms
memory: 8344kb
input:
100000 hlpemexhal ibyjoachka wbfyuksdgc jexrpugwpr hlpemexhal hlpemexhal hltfnoqmom hlpemexhal hlpemexhal hlpemexhal hlpemexhal hlpemexhal hlpemexhal hlpemexhal bzacohfnos xstwvlndbz hlpemexhal hqefhxgbfe hlpemexhal hlpemexhal iuagmmbvso fgrjujwxjl idbhqkinqz hlpemexhal hlpemexhal zqixdryvql xaevgvw...
output:
hlpemexhal
result:
ok "hlpemexhal"
Test #20:
score: 0
Accepted
time: 12ms
memory: 8344kb
input:
100000 urmcaivwjl ywgxywknvs urmcaivwjl pmnwkpluxb pfyallioxd urmcaivwjl urmcaivwjl urmcaivwjl szrzpokmpy urmcaivwjl otcreeksyo qzwxoawnew urmcaivwjl omiapwcaig urmcaivwjl urmcaivwjl urmcaivwjl rbbsfafjui vusiwnzqse zbmnpzfppo wtjltdoswf urmcaivwjl blhsomjtqr urmcaivwjl ytisfepovk urmcaivwjl urmcaiv...
output:
uh-oh
result:
ok "uh-oh"
Test #21:
score: 0
Accepted
time: 12ms
memory: 8136kb
input:
100000 zjnnxxbieu qvfzscuxth xtaetkfrjt wqlnqwgfyu lmukeolidp puibffubxr pbczwlwfih rcnfjfdzfp cmfyxrrmoh chcsqnhsgg lrgwiyfxvc qvfzscuxth hbmetncjqi zjnnxxbieu hcljpkfbzu fygaawozgw oqkfixnmqc puibffubxr quncvjbxvx rlykixoovc wqphjevpif dyddhixwsp chcsqnhsgg qsusthguqi mnhmkpgqoh rlykixoovc rcnfjfd...
output:
uh-oh
result:
ok "uh-oh"
Test #22:
score: 0
Accepted
time: 12ms
memory: 8208kb
input:
100000 aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqzhcc aearjqz...
output:
aearjqzhcc
result:
ok "aearjqzhcc"
Test #23:
score: 0
Accepted
time: 7ms
memory: 8100kb
input:
100000 pvhu pvhu pvhu pvhu gnccul pvhu oegng sis hluqgbhx pvhu jgrywdq yvadglpypw wpvjr pvhu kibnk pvhu nmfwi isoijugnui kvvjspvwj jhywcht pvhu pvhu suhspvi pvhu pvhu oe pvhu egrmvuib pvhu ognoo pvhu hluqgbhx pvhu pvhu wpvjr cm pvhu pvhu lllwmz semptzdiu pvhu pvhu ojsiat wshcjzkfwa oufywcyek pvhu pv...
output:
pvhu
result:
ok "pvhu"
Test #24:
score: 0
Accepted
time: 11ms
memory: 8424kb
input:
100000 grxevo gorl fwzzqtdn bjfkmw fwzzqtdn fwzzqtdn grxevo lzvuniolk yyvkntb fwzzqtdn fwzzqtdn hqu fwzzqtdn xfdmso sckhs fwzzqtdn t fwzzqtdn fwzzqtdn b fwzzqtdn digla fwzzqtdn fwzzqtdn ssju fwzzqtdn bs fwzzqtdn fwzzqtdn fwzzqtdn fwzzqtdn fwzzqtdn ydvtn fwzzqtdn fwzzqtdn fwzzqtdn ogswqszf fwzzqtdn f...
output:
uh-oh
result:
ok "uh-oh"
Test #25:
score: 0
Accepted
time: 11ms
memory: 8236kb
input:
100000 axp uhdxz pjm sfftm e bdzyt e ljfqqit ojkho je jhst ugfr qdhvkqaoe plzdpegtny ojkho cqmkribj kgbq zdfdutqy qdhvkqaoe kgbq he sr e e aowrhp fzcicagows avuegkb xddiuep fzcicagows sp ylnabk dzkrisnpj axp zdfdutqy jswcim dxneu vbjozjmnoq lbzfzpsvxy g gxfhzqhi rdetcphsq jhst omtitjkzk ndkj youekln...
output:
uh-oh
result:
ok "uh-oh"
Test #26:
score: 0
Accepted
time: 4ms
memory: 8232kb
input:
100000 aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlpht aaqlp...
output:
aaqlpht
result:
ok "aaqlpht"
Test #27:
score: 0
Accepted
time: 14ms
memory: 8240kb
input:
100000 bfaryvxrmp bfaryvxrmp bfaryvxrmp bfaryvxrmp tqynutptmt mvpjcdluj bfaryvxrmp nddxqsqo bfaryvxrmp xrjsaqhc snxervezvk bedsybtr bfaryvxrmp bfaryvxrmp mylaogdxe bfaryvxrmp dkdfogcq mvpjcdluj bfaryvxrmp bfaryvxrmp swaquinci bfaryvxrmp bfaryvxrmp bfaryvxrmp bfaryvxrmp bfaryvxrmp bfaryvxrmp bfaryvxr...
output:
bfaryvxrmp
result:
ok "bfaryvxrmp"
Test #28:
score: 0
Accepted
time: 12ms
memory: 8340kb
input:
100000 etepcpifz etepcpifz cmqgzoyg etepcpifz rhvbplao etepcpifz mgwsyyho etepcpifz etepcpifz nxwkehirl etepcpifz sahvpdzxf etepcpifz macduexm rnxtbyepp etepcpifz etepcpifz qovhffzbou etepcpifz etepcpifz etepcpifz etepcpifz etepcpifz nxwkehirl ueocrnyt wtuypvxx ihmhbmwz etepcpifz etepcpifz etepcpifz...
output:
uh-oh
result:
ok "uh-oh"
Test #29:
score: 0
Accepted
time: 9ms
memory: 8168kb
input:
100000 gorpkyngl emshkycsa jbpdcawtt smlnltqljf eyklgridja xwerlucg wourtelv ybaykqrxfk khngbcjcya wxgrfijqzg pgrnqvcvok vrapehupf pgrnqvcvok njwqgatsi fsqpmujqgh ajlpbner coifroekc gdmfqlfsk atungofq vghlmwabnj mbjahbzrs rijqvgzsp lssnfsar fvjgukxmmm xwerlucg dfahudjibt vzgbkdvgo yimuynzj dmyflfitp...
output:
uh-oh
result:
ok "uh-oh"
Test #30:
score: 0
Accepted
time: 10ms
memory: 8208kb
input:
100000 aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenylohp aenyl...
output:
aenylohp
result:
ok "aenylohp"
Test #31:
score: 0
Accepted
time: 19ms
memory: 12156kb
input:
100000 augioxcibo pymkahjdam pymkahjdam howemvtyic pymkahjdam pymkahjdam pymkahjdam zbbwhhlpnz pymkahjdam pymkahjdam pymkahjdam pymkahjdam jrxeekacvb iwqlqxlkis pymkahjdam qjkyuojbqe pymkahjdam pymkahjdam uhbdfeolly pymkahjdam zvazncbthl ecmsljghhv tksjvhqucz jrtdznenhs tigjquhyhg pymkahjdam gopvxtu...
output:
pymkahjdam
result:
ok "pymkahjdam"
Test #32:
score: 0
Accepted
time: 14ms
memory: 12316kb
input:
100000 jylmmprcnt onbyzpvbwl vletdfcmdy vletdfcmdy mwqhtutoeg vletdfcmdy zygpgcjzzt xksimscalq vletdfcmdy yfxhvteuxl vletdfcmdy vletdfcmdy vletdfcmdy vletdfcmdy vletdfcmdy vletdfcmdy vletdfcmdy paxpbrgjtn agsajnulds vsftehcuis intarikeal vletdfcmdy eyuzyibyrj rkkytbtaui vletdfcmdy vletdfcmdy nedpeyr...
output:
uh-oh
result:
ok "uh-oh"
Test #33:
score: 0
Accepted
time: 16ms
memory: 16304kb
input:
100000 wpvlcxcahg jgfvlqskoh zuzidleycf vvsksikike wwcommqgul ismbaqvual amcivcmdim yhnjbryntr wbyafmgork xyrsnpgbtp lyioyzgico oeetpunxin zjfbraxvfi vaujjvpvti ejcjfunmvg phoqksfkqe yrxeapezlr ejjafhpjxb sktivjtbyy yjwjxqqiez epvbaxoime aoffgfhdpq xkofuodyxw vspvhgflsz eqrvgywfls ozlpsootgi mdygjed...
output:
uh-oh
result:
ok "uh-oh"
Test #34:
score: 0
Accepted
time: 13ms
memory: 12312kb
input:
100000 zjwyoy zjwyoy yrydjeudkl zjwyoy eexx wblcnolw nhfsq ooggct verubhve zjwyoy zjwyoy zjwyoy vqkijei joxnqmg zjwyoy kzsiwnsic qghjjg zjwyoy zjwyoy zjwyoy zjwyoy zjwyoy zjwyoy zjwyoy xvfzagopzr zjwyoy zjwyoy zjwyoy cmzlb zjwyoy zjwyoy ctpoa zjwyoy zjwyoy dvcsxfqvb zjwyoy onkmdh zjwyoy bfsctb zjwyo...
output:
zjwyoy
result:
ok "zjwyoy"
Test #35:
score: 0
Accepted
time: 18ms
memory: 12308kb
input:
100000 yfpubkkvwe yfpubkkvwe wiwdbbjx yfpubkkvwe tekzdgpnv yfpubkkvwe yfpubkkvwe cbnd yfpubkkvwe yfpubkkvwe yfpubkkvwe htzxwkeecw ebqehbckk yfpubkkvwe yfpubkkvwe yfpubkkvwe vpsxtvurbc sqe yfpubkkvwe yfpubkkvwe yfpubkkvwe yfpubkkvwe yfpubkkvwe yfpubkkvwe pdysppb yfpubkkvwe yfpubkkvwe yfpubkkvwe dtpi ...
output:
uh-oh
result:
ok "uh-oh"
Test #36:
score: 0
Accepted
time: 15ms
memory: 16240kb
input:
100000 rtxgj enntqjowf knlknxsg wwuzwoov ojikuhbj voaaxoxdp zseoumdut dcmusi yhgrlm knyi avtjps nzq vdahhnb izjuyhr hfakpsn onmf qkogddnqk olqajpztqe ubezvvzonu arldkl cfptkwxh ojlgkh eeout vxnivuwk vtz kjynqczfr dobexwkv jezl xqvwybw ixnbdjij tcdqhw hh brlqf cfnluva kemvnncuul odrf ymcxnir kuevy my...
output:
uh-oh
result:
ok "uh-oh"
Test #37:
score: 0
Accepted
time: 11ms
memory: 12108kb
input:
100000 jqectqvznw jqectqvznw vysdeskfwh jqectqvznw czfbluvs jqectqvznw sllqynrwyf jqectqvznw szgavdqccl jqectqvznw vinjshhvmb kbfhkzgrbb ejruhugtf jqectqvznw fqllkdrm jqectqvznw dtajoktds mriaghtbpz jqectqvznw frjauddnp wrcepxmfbl jqectqvznw aisqmnihc aziphidhy pobkbfky sktdhmuv jqectqvznw jqectqvzn...
output:
jqectqvznw
result:
ok "jqectqvznw"
Test #38:
score: 0
Accepted
time: 13ms
memory: 12508kb
input:
100000 hwxtoajxk wkqcticyu rtcmqumq ducvhhsd ducvhhsd ducvhhsd quwcpuldwz czpjtzvh ducvhhsd ducvhhsd ducvhhsd kumlwriz ducvhhsd ojxblohgv evmrowztg cmlihmhbj obpsqulw ducvhhsd ducvhhsd ducvhhsd ducvhhsd ducvhhsd ducvhhsd ghiylaet ducvhhsd akvgsrxk ducvhhsd ducvhhsd tmbchmrgaa ducvhhsd siepuwxzu ducv...
output:
uh-oh
result:
ok "uh-oh"
Test #39:
score: 0
Accepted
time: 23ms
memory: 16460kb
input:
100000 vlifvcct rmjcqqbfy wnsubtzfl rfyjoceca cfivohuic ftifhhcg zxdbuahtf rsqioohk wsfxrjigiu unuapekm usanfpzor yumepfrou rceiuzckpd bbolgrmuix pcmnffhm pcnildfd liilgxmbl tkqbjewyl aaphuyeu hmpmskglq xwxjckumxw rnjkiaeec jnbegsrzm tswpyagv xifxjgicr ltpdtxygqj elirufhss rmkgejxa trvobipkjw gejbjp...
output:
uh-oh
result:
ok "uh-oh"
Test #40:
score: 0
Accepted
time: 12ms
memory: 8208kb
input:
99999 kfirruopgo bdrsdrzkam qzyspzxznm vwshbqvfye sghxwmxjco vwshbqvfye rvovwmqqjy upfnameteq vxhvikjnjz vwshbqvfye navdreagvq vwshbqvfye hkhvhiwjrx rrypvetihr auuosschcd nvjngcxuyf rvovwmqqjy vwshbqvfye vwshbqvfye vwshbqvfye vwshbqvfye oabfutrnln xidgxbadsi xjvknrbbkp vwshbqvfye vwshbqvfye hdohbjkx...
output:
vwshbqvfye
result:
ok "vwshbqvfye"
Test #41:
score: 0
Accepted
time: 8ms
memory: 8140kb
input:
99999 hekrewdnbi hekrewdnbi augxuqwhgv sqdebivtfu xfiiyoefrg wqdxsjsucy gcbvdmnlga eumqieoeuj hekrewdnbi hekrewdnbi hekrewdnbi hekrewdnbi vbjgemfmji fvminswxxn xfiiyoefrg hekrewdnbi fzsgjbejho hekrewdnbi hekrewdnbi rwxrzrpadq hekrewdnbi iodemcyjhx ywngmmrzly hekrewdnbi hekrewdnbi hekrewdnbi hekrewdn...
output:
uh-oh
result:
ok "uh-oh"
Test #42:
score: 0
Accepted
time: 12ms
memory: 8240kb
input:
99999 ivwthhidij sijrswvips jcgceggshd pncoxnlvrn qgqqkxxqvk effmiukbsw olyisvdsfp qjothjruvw snkfwmioyr nxmnwqkfnz uplxuguiet vgekiqutut vxztzitdfq lkvpnhsppu ybtkjnbdiq hlfwyrmnqf laxcdhyzif hhtoxlfjau tgdrwptxdb ljiwllfyic bzsfrxeqej nxmnwqkfnz pqbgzdprek fzdufzyqua oydgqnxmzn duqigdawrz hkfcvquu...
output:
uh-oh
result:
ok "uh-oh"
Test #43:
score: 0
Accepted
time: 8ms
memory: 8240kb
input:
99999 agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxwpp agcyipxw...
output:
agcyipxwpp
result:
ok "agcyipxwpp"
Test #44:
score: 0
Accepted
time: 10ms
memory: 8204kb
input:
99999 qdy qdy qdy qdy qdy qdy n qdy ajorhdfiy ycfhlaxa qdy qdy qdy jdgrzp qdy n ck qdy rkgpwzboc ww qdy qdy qdy qdy qdy obicxvzb qdy mgbsd qdy qdy qdy qdy flukn qdy qdy udtpx klsspahcsp e qdy qdy klsspahcsp c qdy sn qdy qdy qaifmjtjey udtpx obicxvzb nkluyiai qdy frqghagv qdy vvc vjofny yhr bvkyykev ...
output:
qdy
result:
ok "qdy"
Test #45:
score: 0
Accepted
time: 10ms
memory: 8312kb
input:
99999 qkp oove csin qkp cffz csin ojnofphnfd qkp qkp qkp vyeqzhixn qkp cffz ojnofphnfd abxiscao jsrss qslkwv qkp auxcuzjidx lfkhcww qkp qkp v uaktidk auxcuzjidx qkp fziabaqe qkp snbznuxbx qkp fbkv qkp auxcuzjidx bnjicyuah f xjbzpbx dlwmsjqr sbpctfzw qkp nojqyutge nxbfnuh qkp qzde xhmlq ev qkp jsrss ...
output:
uh-oh
result:
ok "uh-oh"
Test #46:
score: 0
Accepted
time: 7ms
memory: 8200kb
input:
99999 pnohq fwczleyku xpdm ruvfsg z xzq kzufreonza rkq sdsg mbsj w yxpdcya kskqrnyx jiglf sdsg se aliqiidkss yxpdcya lunluvqm fycf n iknmnqn ts ec rtfetsgils pnohq elszdqta tftnjr b e gdfp odaco vtrvmhygjp apxdyon iknmnqn ruvfsg ts yljq pxx iznqq gx qcv laz pz ruvfsg odaco osfomtg kxfwuk iex fwczley...
output:
uh-oh
result:
ok "uh-oh"
Test #47:
score: 0
Accepted
time: 8ms
memory: 8160kb
input:
99999 aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv aingv ...
output:
aingv
result:
ok "aingv"
Test #48:
score: 0
Accepted
time: 9ms
memory: 8320kb
input:
99999 erypvbaox fmplnezq erypvbaox erypvbaox ogwrmtsy mpsbgxzrdl vthapbbonu udrddzlv wqigfykk apvzgitcs erypvbaox erypvbaox erypvbaox erypvbaox ttbdotyzz pfddlrsz erypvbaox btlytqed nnliabekw erypvbaox erypvbaox criicthq erypvbaox erypvbaox erypvbaox wuvzlhsdm erypvbaox erypvbaox erypvbaox erypvbaox...
output:
erypvbaox
result:
ok "erypvbaox"
Test #49:
score: 0
Accepted
time: 11ms
memory: 8424kb
input:
99999 nzalezlq ghdfptpisl nzalezlq nzalezlq wnksxppls nzalezlq nzalezlq nmwlvymhth rjalnerif scvmjaaaz ccuhunly fgbsmecje nzalezlq nzalezlq lxfexhgkj nzalezlq nzalezlq ntlemkkisf nzalezlq nmwlvymhth nzalezlq xbvdtvcy scvmjaaaz rjmtmtrkvb ghdfptpisl nzalezlq zupjazoog daqsppav nzalezlq qundezkgj zewp...
output:
uh-oh
result:
ok "uh-oh"
Test #50:
score: 0
Accepted
time: 13ms
memory: 8424kb
input:
99999 igfqkggf uyspmhbneq vgrsvnxe qyvprfrth kfmjsvhezz ftveeenwg plxpavpo rceaysgay ttdqxdeg plxpavpo xfflauxlf zrmaljgui ccsxhupdq pkdkprkoj cumganey ikkbuakyku qivdtoimsh vibjcvgcdy vogowxgzj rmnqdefix owucboyml nlsvblxz urtcjxcl urtcjxcl yohyeewvtr ivhcyhig ctrbjctxiv lhlqynswsv xuiqoqyj qyvprfr...
output:
uh-oh
result:
ok "uh-oh"
Test #51:
score: 0
Accepted
time: 6ms
memory: 8140kb
input:
99999 ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympkte ajympk...
output:
ajympkte
result:
ok "ajympkte"
Extra Test:
score: 0
Extra Test Passed