Submission #38380803


Source Code Expand

#include <iostream>
#define N 1100
using namespace std;
int n, m, s[N], t[N];
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    cin >> s[i];
  for (int i = 1; i <= m; i++)
    cin >> t[i];
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    bool flag = 0;
    for (int j = 1; j <= m; j++)
      flag |= (s[i] % 1000 == t[j]);
    ans += flag;
  }
  cout << ans << '\n';
  return 0;
}

Submission Info

Submission Time
Task B - Postal Card
User swiftc
Language C++ (Clang 10.0.0)
Score 200
Code Size 452 Byte
Status AC
Exec Time 9 ms
Memory 3136 KiB

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 9 ms 3028 KiB
00_example_01.txt AC 2 ms 3028 KiB
00_example_02.txt AC 2 ms 3052 KiB
01_all_00.txt AC 5 ms 3116 KiB
02_none_00.txt AC 3 ms 3072 KiB
03_random_00.txt AC 4 ms 3072 KiB
03_random_01.txt AC 3 ms 3132 KiB
03_random_02.txt AC 4 ms 3072 KiB
03_random_03.txt AC 2 ms 3016 KiB
03_random_04.txt AC 2 ms 3028 KiB
03_random_05.txt AC 4 ms 2996 KiB
03_random_06.txt AC 3 ms 3104 KiB
03_random_07.txt AC 3 ms 2988 KiB
03_random_08.txt AC 2 ms 2992 KiB
03_random_09.txt AC 3 ms 3136 KiB