結果

問題 No.2372 既視感
ユーザー Akihiro-muraiAkihiro-murai
提出日時 2024-03-19 20:59:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 1,773 ms
コンパイル使用メモリ 175,456 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-19 20:59:57
合計ジャッジ時間 3,189 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 WA -
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 WA -
testcase_09 AC 3 ms
6,676 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
6,676 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 5 ms
6,676 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 5 ms
6,676 KB
testcase_28 AC 5 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
	deque<string> A;
	int n,k,q,qn,d;
	string qname;
	cin >>n>>k>>q;
	
	for (int i=0;i<q;i++){
		cin >>qn;
		if (qn==1){
			cin >>qname;
			A.emplace_back(qname);
			if(A.size()>n){
				A.pop_front();
			}
		}else{
			int sum = 0,ans;
			bool f= true;
			for(int j=0;j<6;j++){
				
				cin>>qname>>d;
				if(f&&find(A.cbegin(),A.cend(),qname)!=A.end()){
					sum+=min(k,d);
				}else if (f){
					sum+=d;
				}
				if(f&&sum>60){
					ans= j;
					f = false;
				}
				A.emplace_back(qname);
				
				
			}
			if(f)ans=6;
			cout <<ans<<endl;
			while(A.size()>n){
				A.pop_front();
			}
		}
		
		
		
	}
}
0