Submission #1213096
Source Code Expand
#[allow(unused_imports)] use std::cmp::*; #[allow(unused_imports)] use std::collections::*; use std::io::Read; #[allow(dead_code)] fn getline() -> String { let mut ret = String::new(); std::io::stdin().read_line(&mut ret).ok().unwrap(); ret } fn get_word() -> String { let mut stdin = std::io::stdin(); let mut u8b: [u8; 1] = [0]; loop { let mut buf: Vec<u8> = Vec::with_capacity(16); loop { let res = stdin.read(&mut u8b); if res.unwrap_or(0) == 0 || u8b[0] <= b' ' { break; } else { buf.push(u8b[0]); } } if buf.len() >= 1 { let ret = String::from_utf8(buf).unwrap(); return ret; } } } #[allow(dead_code)] fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() } fn solve() { let n = get(); let s: Vec<Vec<_>> = (0 .. n).map(|_| get_word().chars().collect()) .collect(); let t: Vec<_> = get_word().chars().collect(); let mut le = 0; let mut ge = 0; for i in 0 .. n { if s[i] <= t { le += 1; } if s[i] >= t { ge += 1; } } for i in n - ge .. le + 1 { print!("{}{}", i + 1, if i == le { "\n" } else { " " }); } } fn main() { // In order to avoid potential stack overflow, spawn a new thread. let stack_size = 104_857_600; // 100 MB let thd = std::thread::Builder::new().stack_size(stack_size); thd.spawn(|| solve()).unwrap().join().unwrap(); }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | kobae964 |
Language | Rust (1.15.1) |
Score | 130 |
Code Size | 1558 Byte |
Status | WA |
Exec Time | 8 ms |
Memory | 8572 KB |
Judge Result
Set Name | Subtask1 | Subtask2 | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 130 / 130 | 0 / 120 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Subtask1 | sub1_in1.txt, sub1_in2.txt, sub1_in3.txt |
Subtask2 | sub1_in1.txt, sub1_in2.txt, sub1_in3.txt, sub2_in1.txt, sub2_in2.txt, sub2_in3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sub1_in1.txt | AC | 3 ms | 8572 KB |
sub1_in2.txt | AC | 3 ms | 8572 KB |
sub1_in3.txt | AC | 3 ms | 8572 KB |
sub2_in1.txt | WA | 3 ms | 8572 KB |
sub2_in2.txt | WA | 6 ms | 8572 KB |
sub2_in3.txt | WA | 8 ms | 8572 KB |