結果

問題 No.714 回転寿司屋のシミュレート
ユーザー sggkshio
提出日時 2018-11-26 01:09:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 1,157 bytes
コンパイル時間 1,277 ms
コンパイル使用メモリ 93,412 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-25 23:16:32
合計ジャッジ時間 2,653 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
using namespace std;
//#include<bits/stdc++.h>
int main() {
int n;
cin >> n;
bool f[22] = {};
map<int, vector<string>>r;
while (n--) {
int x;
cin >> x;
if (!x) {
int a, b;
cin >> a >> b;
f[a] = 1;
for (int i = 0; i < b; i++) {
string p;
cin >> p;
r[a].push_back(p);
}
//cout << a << endl;;
}
if (x == 1) {
string p;
cin >> p;
bool z = 1;
for (int i = 1; i <= 20; i++) {
//cout << f[i];
if (f[i]) {
// cout << i;
for (int j = 0; j < r[i].size(); j++) {
if (r[i][j] == p) {
cout << i << endl;
r[i][j] = "0";
z = 0; break;
}
}
}
if (!z)break;
}
if (z)cout << -1 << endl;
}
if (x == 2) {
int a;
cin >> a;
f[a] = 0;
r[a].clear();
// cout << a << endl;
}
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0