标签:sam size mes efault == str printf put out
题目链接:http://acm.zzuli.edu.cn/problem.php?id=2628
2
3 3
abc
def
ghi
jklmnopqrstuvwxyz
2 3
uvw
xyz
abc
Yes
No
#include<set> #include<map> #include<stack> #include<queue> #include<cmath> #include<cstdio> #include<cctype> #include<string> #include<vector> #include<climits> #include<cstring> #include<cstdlib> #include<iostream> #include<algorithm> #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #define mst(a) memset(a, 0, sizeof(a)) #define _test printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n") using namespace std; typedef long long ll; typedef pair<int, int> P; const double eps = 1e-7; const int INF = 0x3f3f3f3f; const ll ll_INF = 0x3f3f3f3f3f3f3f; const int maxn = 1e3+10; char _map[maxn][maxn], s[maxn*100]; bool solve(int n, int m) { int len = strlen(s); for (int i = 0; i<n; ++i) for (int j = 0; j<m; ++j) if (_map[i][j] < s[0] || (_map[i][j] == s[0] && len > 1)) return true; return false; } int main(void) { int t; scanf("%d", &t); while(t--) { int n, m; scanf("%d%d", &n, &m); for (int i = 0; i<n; ++i) scanf("%s", _map[i]); scanf("%s", s); printf(solve(n,m) ? "Yes\n" : "No\n"); } return 0; }
标签:sam size mes efault == str printf put out
原文地址:https://www.cnblogs.com/shuitiangong/p/12081170.html