ZOJ
来源:互联网 发布:文字图片制作软件 编辑:程序博客网 时间:2024/06/06 00:02
//其实也算水题,关键是要耐心做,不要浮躁#include <cstdio>#include <iostream>#include <string>#include <cstring>using namespace std;const int maxn = 205;string name[maxn];int ans[maxn];int rec[maxn][maxn]; //record[i][j] 为第i个人的第j个回答 int main(){int t;cin >> t;while (t--){memset(rec, 0, sizeof(rec));int n, q, c, d;cin >> n >> q >> c;for (int i = 0; i < c; i++) cin >> name[i];for (int i = 0; i < q; i++) //枚举题目 {int num; string x;cin >> num;while (num--){cin >> x;for (int j = 0; j < c; j++) //枚举人 {if (name[j] == x){rec[j][i] = 1;}}}}for (int i = 0; i < n; i++) // 枚举要找的朋友数 {int fj; // fianl jfor (int j = 0; j < q; j++) cin >> ans[j]; // 将当前要找的人,的所有答案输入 int cnt = 0; // countint m;for (int k = 0; k < c; k++) // 枚举人 {bool flag = true; for (m = 0; m < q; m++) //枚举q道题的答案 if (ans[m] != rec[k][m]){flag = false;break;}if (flag){cnt++;fj = k;}}if (cnt == 1) cout << name[fj] << endl;else cout << "Let's go to the library!!" << endl;}}return 0;}
阅读全文
0 0
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- javascript——基本类型和引用类型
- eclipse c 动态库
- LeetCode 235. Lowest Common Ancestor of a Binary Search Tree
- KAFKA 常用命令
- 软件测试人员必备Linux命令(初、中、高级)
- ZOJ
- python进度条 tqdm 解析
- 移动应用安全威胁如影随形,APP安全加固迫在眉睫
- 深入理解java的可序列化
- 扫地机器人十大排名
- LLDB 调试进阶
- nginx(三) nginx配置:反向代理 负载均衡 后端健康检查 缓存
- POJ
- python2.7以下出 NameError: global name 'FileNotFoundError' is not defined的解决方案