結果

問題 No.2828 Remainder Game
ユーザー ikomaikoma
提出日時 2024-08-02 22:01:12
言語 Rust
(1.77.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 1,960 bytes
コンパイル時間 12,995 ms
コンパイル使用メモリ 378,236 KB
実行使用メモリ 25,232 KB
平均クエリ数 22.00
最終ジャッジ日時 2024-08-02 22:01:28
合計ジャッジ時間 15,024 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
25,232 KB
testcase_01 AC 72 ms
25,232 KB
testcase_02 AC 62 ms
24,592 KB
testcase_03 AC 63 ms
24,976 KB
testcase_04 AC 60 ms
24,592 KB
testcase_05 AC 61 ms
24,964 KB
testcase_06 AC 63 ms
24,836 KB
testcase_07 AC 61 ms
24,836 KB
testcase_08 AC 62 ms
24,580 KB
testcase_09 AC 63 ms
24,964 KB
testcase_10 AC 63 ms
24,580 KB
testcase_11 AC 62 ms
24,836 KB
testcase_12 AC 62 ms
24,836 KB
testcase_13 AC 83 ms
24,580 KB
testcase_14 AC 62 ms
24,964 KB
testcase_15 AC 62 ms
24,640 KB
testcase_16 AC 63 ms
25,208 KB
testcase_17 AC 63 ms
24,952 KB
testcase_18 AC 63 ms
24,568 KB
testcase_19 AC 63 ms
24,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(unused_imports, dead_code, unused_macros, unused_variables, non_snake_case, unused_parens)]
use proconio::{input, input_interactive, marker::{Bytes, Chars, Isize1, Usize1}};
use std::ops::*;
use std::cmp::*;
use std::mem::swap;
use std::collections::*;

const MOD:u64 = 1_000_000_007;
const INF:i64 = 0x3fff_ffff_ffff_ffff;

macro_rules! min {($a:expr $(,)*) => {{$a}};($a:expr, $b:expr $(,)*) => {{std::cmp::min($a, $b)}};($a:expr, $($rest:expr),+ $(,)*) => {{std::cmp::min($a, min!($($rest),+))}};}
macro_rules! max {($a:expr $(,)*) => {{$a}};($a:expr, $b:expr $(,)*) => {{std::cmp::max($a, $b)}};($a:expr, $($rest:expr),+ $(,)*) => {{std::cmp::max($a, max!($($rest),+))}};}
macro_rules! chmin {($base:expr, $($cmps:expr),+ $(,)*) => {{let cmp_min = min!($($cmps),+);if $base > cmp_min {$base = cmp_min;true} else {false}}};}
macro_rules! chmax {($base:expr, $($cmps:expr),+ $(,)*) => {{let cmp_max = max!($($cmps),+);if $base < cmp_max {$base = cmp_max;true} else {false}}};}
macro_rules! mulvec {($x:expr; $s:expr) => {vec![$x; $s]};($x:expr; $s0:expr; $( $s:expr );+) => {mulvec![vec![$x; $s0]; $( $s );+ ]};}
macro_rules! outputln {($var:expr)=>{println!("{}",$var)};($var:expr,$($vars:expr),+)=>{print!("{} ",$var);outputln!($($vars),+);};}
macro_rules! debug {($($a:expr),* $(,)*) => {eprintln!(concat!($("| ",stringify!($a), "={:?} "),*, "|"),$(&$a),*);};}


fn solve() {
    input_interactive! {
        n: usize,
    }
	let mut ans = 0;
	for i in 1..=10 {
		println!("{} {}", 1<<i, 1<<(i-1));
		let out = (0..(1<<(i-1))).map(|j| (((1<<(i-1))+j))).collect::<Vec<i32>>();
		println!("{}", out.iter().map(std::string::ToString::to_string).collect::<Vec<_>>().join(" "));
		input_interactive!(c: usize);
		ans += (1<<(i-1)) * c;
		debug!(c, ans);
	}
	println!("0 1");
    println!("{}", ans);
}

fn main() {
    std::thread::Builder::new()
        .stack_size(128 * 1024 * 1024)
        .spawn(|| solve()).unwrap()
        .join().unwrap();
}

0