Submission #15894718


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        mut a: i64,
        mut b: i64,
        k: usize,
    };
    for i in 0..k {
        if i % 2 == 0 {
            if a % 2 != 0 {
                a -= 1;
            }
            a /= 2;
            b += a;
        } else {
            if b % 2 != 0 {
                b -= 1;
            }
            b /= 2;
            a += b;
        }
    }
    println!("{} {}", a, b);
}

Submission Info

Submission Time
Task B - Exchange
User bouzuya
Language Rust (1.42.0)
Score 200
Code Size 432 Byte
Status AC
Exec Time 6 ms
Memory 2144 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 11
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 6 ms 2080 KB
02.txt AC 2 ms 2080 KB
03.txt AC 2 ms 1988 KB
04.txt AC 1 ms 2028 KB
05.txt AC 5 ms 2040 KB
06.txt AC 2 ms 1880 KB
07.txt AC 1 ms 2116 KB
08.txt AC 1 ms 2088 KB
s1.txt AC 2 ms 2060 KB
s2.txt AC 1 ms 2052 KB
s3.txt AC 2 ms 2144 KB