Language: C

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr = (input.trim()).split("\n");

const binarySearch = (key, arr, N) => {
  let mid;
  let left = 0;
  let right = N;
  if (key < arr[0] || arr[N-1] < key) return 0;
  while (left < right) {
    mid = Math.floor((left + right) / 2);
    if (key < arr[mid]) right = mid;
    else if (key > arr[mid]) left = mid + 1;
    else return 1;
  }
  return 0;
}


(function() {
  const input = require('fs').readFileSync('/dev/stdin', 'utf8');
  const Arr = (input.trim()).split("\n");
  const N1 = Number(Arr[0]);
  const arr1 = Arr[1].split(" ").map(Number);
  // const N2 = Number(Arr[2]);
  const arr2 = Arr[3].split(" ").map(Number);
  console.log(arr2.map(e => binarySearch(e, arr1, N1)).reduce((a, b) => a + b, 0));
})();



Compiler output:
main.c:1:1: error: unknown type name 'var'
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      | ^~~
main.c:1:13: error: implicit declaration of function 'require' [-Wimplicit-function-declaration]
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |             ^~~~~~~
main.c:1:21: warning: multi-character character constant [-Wmultichar]
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                     ^~~~
main.c:1:26: error: request for member 'readFileSync' in something not a structure or union
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                          ^
main.c:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                        ^~~~~~~~~~~~
main.c:1:54: warning: multi-character character constant [-Wmultichar]
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                                      ^~~~~~
main.c:2:1: error: unknown type name 'var'
    2 | var Arr = (input.trim()).split("\n");
      | ^~~
main.c:2:17: error: request for member 'trim' in something not a structure or union
    2 | var Arr = (input.trim()).split("\n");
      |                 ^
main.c:4:7: error: type defaults to 'int' in declaration of 'binarySearch' [-Wimplicit-int]
    4 | const binarySearch = (key, arr, N) => {
      |       ^~~~~~~~~~~~
main.c:4:23: error: 'key' undeclared here (not in a function)
    4 | const binarySearch = (key, arr, N) => {
      |                       ^~~
main.c:4:28: error: 'arr' undeclared here (not in a function); did you mean 'Arr'?
    4 | const binarySearch = (key, arr, N) => {
      |                            ^~~
      |                            Arr
main.c:4:33: error: 'N' undeclared here (not in a function)
    4 | const binarySearch = (key, arr, N) => {
      |                                 ^
main.c:4:37: error: expected expression before '>' token
    4 | const binarySearch = (key, arr, N) => {
      |                                     ^
main.c:19:12: error: expected ')' before '{' token
   19 | (function() {
      |            ^~
      |            )
main.c:20:25: warning: multi-character character constant [-Wmultichar]
   20 |   const input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                         ^~~~
main.c:20:44: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   20 |   const input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                            ^~~~~~~~~~~~
main.c:20:58: warning: multi-character character constant [-Wmultichar]
   20 |   const input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                                          ^~~~~~