Submission #1271770

#TimeUsernameProblemLanguageResultExecution timeMemory
1271770cbnk32_tuandungPizza (COCI21_pizza)C++17
50 / 50
0 ms328 KiB
/*  _  _   ___   __  ___  ___  _  _  ___  __   ___     _   _  ___   ___  __   _____  _  _  ___       */
/* | || | /_\ \ / / / __|/ _ \| \| |/ __| \ \ / /_\   | | | |/ _ \ / __| \ \ / / _ \| \| |/ __|      */
/* | __ |/ _ \ V /  \__ \ (_) | .` | (_ |  \ V / _ \  | |_| | (_) | (__   \ V / (_) | .` | (_ |      */
/* |_||_/_/_\_\_|___|___/\___/|_|\_|\___|   \_/_/_\_\ _\___/ \___/ \___| _ \_/_\___/|_|\_|\___| ___  */
/* |   \| __| |_   _| || | /_\ \ / / |   \ / _ \_ _| |  \/  | __| \| | || | |  \/  |/ _ \| \| |/ __| */
/* | |) | _|    | | | __ |/ _ \ V /  | |) | (_) | |  | |\/| | _|| .` | __ | | |\/| | (_) | .` | (_ | */
/* |___/|___|   |_| |_||_/_/ \_\_|   |___/ \___/___| |_|  |_|___|_|\_|_||_| |_|  |_|\___/|_|\_|\___| */

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

int a[109];

int main() {
	ios_base::sync_with_stdio(1+1==3);
	cout.tie(nullptr); cin.tie(nullptr);
	int n; cin >> n;
	for (int i = 1; i <= n; ++i) cin >> a[i];
	int m; cin >> m;
	int res=0;
	for (int i = 1; i <= m; ++i) {
		int k; cin >> k;
		bool ok=true;
		for (int j = 1; j <= k; ++j) {
			int b; cin >> b;
			if (ok) {
				for (int f = 1; f <= n; ++f) {
					if (b==a[f]) {
						ok=false;
						break;
					}
				}
			}
		}
		res+=ok;
	}
	cout << res;
}

/*
Hôm nay trời vẫn mưa tầm tã,trốn việc lang thang một tiếng trên đường..
Từng hạt mưa rơi xuống đầu,văng xuống đường, tan ra từng mảnh vụn,hòa vào dòng nước...rồi theo nhau chui vào lỗ cống..he he
*/
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...