結果

問題 No.511 落ちゲー 〜手作業のぬくもり〜
ユーザー YukiDarumaYukiDaruma
提出日時 2017-04-29 00:07:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 801 bytes
コンパイル時間 3,084 ms
コンパイル使用メモリ 165,116 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-10-11 20:00:46
合計ジャッジ時間 16,262 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
testcase_21 AC 2 ms
4,352 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 3 ms
4,352 KB
testcase_24 AC 2 ms
4,352 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 1 ms
4,352 KB
testcase_27 AC 2 ms
4,352 KB
testcase_28 AC 3 ms
4,348 KB
testcase_29 AC 3,751 ms
4,432 KB
testcase_30 AC 3,113 ms
4,348 KB
testcase_31 AC 1,517 ms
4,348 KB
testcase_32 TLE -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

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;
int iEnd;
	// 入力
	cin >> n;
	cin >> w;
	cin >> h;

	iA = 0;
	iB = 0;
	iCnt = w;
	for( i = 0; i < n; i++ )
	{
		cin >> a;
		cin >> b;
		cin >> x;
		iEnd = a + x;
		for( j = x; j < iEnd; j++ )
		{
			if( ! R[ j ] )
			{
				T[ j ] += b;
				if( T[ j ] >= h )
				{
					R[ j ] = 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