結果

問題 No.511 落ちゲー 〜手作業のぬくもり〜
ユーザー YukiDaruma
提出日時 2017-04-29 00:01:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 789 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 168,016 KB
実行使用メモリ 11,040 KB
最終ジャッジ日時 2024-09-13 18:45:50
合計ジャッジ時間 14,475 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 27 TLE * 1 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

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

namespace
{
int n;
int w;
long long h;
long long T[ 100010 ];
bool R[ 100010 ];
int a;
int b;
int x;
}

int main( int argc, char *argv[] )
{
int i;
int j;
int iA;
int iB;
int iCnt;

	// 入力
	cin >> n;
	cin >> w;
	cin >> h;

	iA = 0;
	iB = 0;
	iCnt = w;
	for( i = 0; i < n; i++ )
	{
		cin >> a;
		cin >> b;
		cin >> x;
		for( j = 0; j < a; j++ )
		{
			if( ! R[ j + x ] )
			{
				T[ j + x ] += b;
				if( T[ j + x ] >= h )
				{
					R[ j + x ] = true;
					if( i % 2 == 0 )
						iA++;
					else
						iB++;

					iCnt--;
					if( iCnt == 0 ) break;
				}
			}
		}

		if( iCnt == 0 ) break;
	}

	// 出力
	if( iA > iB )
		cout << "A" << endl;
	else if( iA < iB )
		cout << "B" << endl;
	else
		cout << "DRAW" << endl;

	return 0;
}




0