結果

問題 No.1004 サイコロの実装 (2)
コンテスト
ユーザー forest3
提出日時 2020-03-24 14:59:34
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 469 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,093 ms
コンパイル使用メモリ 179,284 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-05 03:37:18
合計ジャッジ時間 2,896 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;


int main()
{
	long long a, b, x0, N;
	cin >> a >> b >> x0 >> N;

	long long ans = (N * 2 - 1 + 2) / 4;
	long long ans1 = 0;
	long long ans2 = 0;
	if( a % 2 == 0 ) {
		if( b % 2 == 0 ) {
			ans1 = ans;
			ans2 = ans;
		}
	}
	else {
		if( b % 2 == 0 ) {
			if( x0 % 2 == 0 ) {
				ans1 = ans;
				ans2 = ans;
			}
		}
		else {
			if( x0 % 2 ) ans1 = ans;
			else ans2 = ans;
		}
	}

	cout << ans1 << " " << ans2 << endl;
}
0