This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[tokio::test(flavor = "multi_thread")] | |
async fn test_buffered_unordered() { | |
use futures::FutureExt; | |
let mut futs = vec![]; | |
futs.push(async move { 1 / 0 }.boxed()); | |
for i in 1..=10 { | |
futs.push(async move { i }.boxed()) | |
} | |
let stream = futures::stream::iter(futs); | |
let mut buffered = stream.buffer_unordered(100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl X { | |
fn f(&self) -> Y { | |
} | |
} | |
let x: X; | |
// (1) | |
std::thread::spawn(move || { | |
let y = x.f(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use cargo_snippet::snippet; | |
use std::collections::HashMap; | |
#[snippet(BabyStepGiantStep)] | |
pub trait BSGSable { | |
type T: std::fmt::Debug; | |
type K: std::hash::Hash + std::cmp::Eq; | |
fn inv(x: &Self::T, mo: u64) -> Self::T; | |
fn unit() -> Self::T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://atcoder.jp/contests/typical90/tasks/typical90_k | |
fn solve() { | |
let out = stdout(); | |
let mut out = BufWriter::new(out.lock()); | |
input!{ | |
n:usize, | |
dcs:[(usize,usize,i64);n], | |
} | |
let mut dcs=dcs; dcs.sort_by_key(|x|x.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```c | |
int abs(int x) { | |
if (x >= 0) { | |
return x; | |
} else { | |
return -x; | |
} | |
} | |
int main(void) { | |
return abs(-3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait BlockDevice { | |
fn write(&mut self); | |
} | |
type sector_t = u64; | |
struct Local { | |
path: String | |
} | |
impl BlockDevice for Local { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn solve() { | |
let out = stdout(); | |
let mut out = BufWriter::new(out.lock()); | |
input!{ | |
new_stdin_parser = parser, | |
t: usize, | |
} | |
for _ in 0..t { | |
input!{ | |
parser = parser, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
わかるかこの美しさ。 | |
--,--,--,--,--,--,--,--,09 | |
--,--,--,--,--,--,--,--,09,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,44 | |
--,--,--,--,--,--,--,--,09,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,37,--,--,40,--,--,--,44 | |
--,--,--,--,--,--,--,--,09,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,29,30,--,--,--,34,--,--,37,--,--,40,--,--,--,44,--,46 | |
01,--,--,--,--,--,--,08,09,--,--,--,--,--,--,16,--,--,--,20,--,--,--,--,--,26,--,--,29,30,--,--,--,34,--,36,37,--,--,40,--,42,--,44,45,46 | |
01,--,03,--,--,--,07,08,09,10,11,--,13,--,15,16,--,--,19,20,--,--,23,24,25,26,27,--,29,30,--,32,33,34,--,36,37,--,--,40,--,42,--,44,45,46,--,48,49 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--,--,--,--,--,06 | |
--,--,--,--,--,06 | |
--,--,--,--,--,06 | |
--,--,--,--,--,06 | |
00,--,--,--,--,06 | |
00,--,--,--,--,06,--,08,09 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0529 | |
TEST=[] | |
(n,m) = map(int, input().split()) | |
while (n,m) != (0,0): | |
ps = [0] | |
for _ in range(n): | |
p = int(input()) | |
ps.append(p) | |
TEST.append((m, ps)) |
NewerOlder