結果
| 問題 | No.3659 CONSTRUCTION 1,2,3 |
| コンテスト | |
| ユーザー |
ikoma
|
| 提出日時 | 2026-08-30 15:46:25 |
| 言語 | Rust (1.97.1 + proconio + num + itertools) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,163 bytes |
| 記録 | |
| コンパイル時間 | 3,394 ms |
| コンパイル使用メモリ | 193,512 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 15:46:31 |
| 合計ジャッジ時間 | 3,657 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 1 |
ソースコード
#![allow(unused_imports, dead_code, unused_macros, unused_variables, non_snake_case, unused_parens)]
use proconio::{input,marker::{Bytes, Chars, Usize1,Isize1}};
use std::ops::*;
use std::cmp::*;
use std::mem::swap;
use std::collections::*;
use num::integer::*;
use itertools::*;
const MOD:usize = 998244353;
const INF:i64 = 0x3fff_ffff_ffff_ffff;
const YES:&str="Yes";const NO:&str="No";macro_rules!yesno{($var:expr) => {if $var{println!("{}",YES);}else{println!("{}",NO);}}}
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!{
mut A: u128,
mut B: u128,
mut C: u128,
}
if A * B * C % 6 != 0 {
yesno!(false);
return;
}
while A*B*C > 0 {
let mut flg = false;
for (a,b,c) in [(1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1)] {
let mut cnt = 0;
if A % a == 0 {
cnt += 1;
}
if B % b == 0 {
cnt += 1;
}
if C % c == 0 {
cnt += 1;
}
if cnt > 1 {
A %= a;
B %= b;
C %= c;
flg = true;
}
}
if flg {continue}
break;
}
yesno!(A*B*C == 0);
}
fn main() {
std::thread::Builder::new()
.stack_size(128 * 1024 * 1024)
.spawn(|| solve()).unwrap()
.join().unwrap();
}
ikoma