結果
問題 | No.714 回転寿司屋のシミュレート |
ユーザー |
![]() |
提出日時 | 2018-07-13 22:41:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 1,201 bytes |
コンパイル時間 | 659 ms |
コンパイル使用メモリ | 74,476 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 05:25:25 |
合計ジャッジ時間 | 1,721 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <algorithm>#include <cstdio>#include <cstring>#include <cmath>using namespace std;using ll = long long;int main() {ios::sync_with_stdio(false);cin.tie(0);int q;cin >> q;char c[20][10][18];int p[20] = {};for (int i = 0; i < q; i++) {int t;cin >> t;if (t == 0) {int n, m;cin >> n >> m;n--;for (int j = 0; j < m; j++) {cin >> c[n][j];}p[n] = m;} else if (t == 1) {char s[18];cin >> s;int r = -1;for (int i = 0; i < 20; i++) {int m = p[i];for (int j = 0; j < m; j++) {if (strcmp(s, c[i][j]) == 0) {c[i][j][0] = 0;r = i + 1;break;}}if (r >= 0) break;}cout << r << '\n';} else {int n;cin >> n;n--;p[n] = 0;}}return 0;}