ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#212107 | #3817. 写字 | zhangry | Compile Error | / | / | C++ | 659b | 2024-10-13 11:16:19 | 2024-10-13 12:23:30 |
answer
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define awa return 0;
using namespace std;
int n,m;
string s,t;
bool find(string s,string t)
{
unordered_map<char,int>scnt;
for(char c:s)
{
scnt[c]++;
}
unordered_map<char,int>tcnt;
for(char c:t)
{
tcnt[c]++;
if(scnt[c]<tcnt[c])
{
return false;
}
}
return true;
}
signed main()
{
IOS;
cin>>n>>m;
cin>>s>>t;
if(find(s,t))
{
}
else
{
cout<<-1;
awa
}
awa
}
//
Details
answer.code: In function 'bool find(std::string, std::string)': answer.code:10:5: error: 'unordered_map' was not declared in this scope unordered_map<char,int>scnt;\x0d ^ answer.code:10:19: error: expected primary-expression before 'char' unordered_map<char,int>scnt;\x0d ^ answer.code:10:19: error: expected ';' before 'char' answer.code:11:16: error: range-based 'for' loops are not allowed in C++98 mode for(char c:s)\x0d ^ answer.code:13:9: error: 's...