Submission #38384518


Source Code Expand

#include <bits/stdc++.h>
#define st first
#define nd second
#define db double
#define re register
#define pb push_back
#define mk make_pair
#define int long long
#define ldb long double
#define pii pair<int, int>
#define ull unsigned long long
#define mst(a, b) memset(a, b, sizeof(a))
using namespace std;
const int N = 1e3 + 10;
inline int read()
{
  int s = 0, w = 1;
  char ch = getchar();
  while(ch < '0' || ch > '9') { if(ch == '-') w *= -1; ch = getchar(); }
  while(ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
int n, m;
string s[N];
map<string, bool> mp;
signed main()
{
  n = read(), m = read();
  for(re int i = 1; i <= n; i++) cin >> s[i];
  for(re int i = 1; i <= m; i++){
    string x; cin >> x, mp[x] = true;
  }
  int ans = 0;
  for(re int i = 1; i <= n; i++){
    string t = "...";
    for(re int j = 3; j < 6; j++) t[j - 3] = s[i][j];
    if(mp[t]) ans += 1;
  }
  printf("%lld\n", ans);
  return 0;
}

Submission Info

Submission Time
Task B - Postal Card
User Booksnow
Language C++ (GCC 9.2.1)
Score 200
Code Size 996 Byte
Status AC
Exec Time 7 ms
Memory 3752 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:29:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   29 |   for(re int i = 1; i <= n; i++) cin >> s[i];
      |              ^
./Main.cpp:30:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   30 |   for(re int i = 1; i <= m; i++){
      |              ^
./Main.cpp:34:14: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   34 |   for(re int i = 1; i <= n; i++){
      |              ^
./Main.cpp:36:16: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   36 |     for(re int j = 3; j < 6; j++) t[j - 3] = s[i][j];
      |                ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 15
Set Name Test Cases
Sample 00_example_00.txt, 00_example_01.txt, 00_example_02.txt
All 00_example_00.txt, 00_example_01.txt, 00_example_02.txt, 01_all_00.txt, 02_none_00.txt, 03_random_00.txt, 03_random_01.txt, 03_random_02.txt, 03_random_03.txt, 03_random_04.txt, 03_random_05.txt, 03_random_06.txt, 03_random_07.txt, 03_random_08.txt, 03_random_09.txt
Case Name Status Exec Time Memory
00_example_00.txt AC 7 ms 3500 KiB
00_example_01.txt AC 2 ms 3576 KiB
00_example_02.txt AC 2 ms 3572 KiB
01_all_00.txt AC 3 ms 3636 KiB
02_none_00.txt AC 2 ms 3628 KiB
03_random_00.txt AC 3 ms 3644 KiB
03_random_01.txt AC 2 ms 3752 KiB
03_random_02.txt AC 2 ms 3568 KiB
03_random_03.txt AC 2 ms 3748 KiB
03_random_04.txt AC 2 ms 3556 KiB
03_random_05.txt AC 2 ms 3692 KiB
03_random_06.txt AC 2 ms 3552 KiB
03_random_07.txt AC 2 ms 3688 KiB
03_random_08.txt AC 2 ms 3616 KiB
03_random_09.txt AC 3 ms 3584 KiB