Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var (
	sc = bufio.NewScanner(os.Stdin)
)

type Point struct {
	X, Y int
}

type Gem struct {
	ID int
	Point
}

type Map struct {
	Current       *Point
	Gems          map[int]*Gem
	CollectedGems map[int]*Gem
}

func (m *Map) Move(dir string, l int) {
	switch {
	case dir == "N" || dir == "S":
		a := 1
		if dir == "S" {
			a = -1
		}
		for i := 0; i < l; i++ {
			m.Current.Y += a
			for _, g := range m.Gems {
				m.TryToTakeGem(g)
			}
		}
	case dir == "E" || dir == "W":
		a := 1
		if dir == "W" {
			a = -1
		}
		for i := 0; i < l; i++ {
			m.Current.X += a
			for _, g := range m.Gems {
				m.TryToTakeGem(g)
			}
		}
	}
}

func (m *Map) HasCompleted() bool {
	return len(m.Gems) == 0
}

func (m *Map) TryToTakeGem(g *Gem) {
	if m.Current.X == g.X && m.Current.Y == g.Y {
		m.CollectedGems[g.ID] = g
		delete(m.Gems, g.ID)
	}
}

func main() {
	for sc.Scan() {
		n, _ := strconv.Atoi(sc.Text())
		if n == 0 {
			break
		}
		m := &Map{
			Current:       &Point{X: 10, Y: 10},
			Gems:          map[int]*Gem{},
			CollectedGems: map[int]*Gem{},
		}
		for i := 0; i < n; i++ {
			sc.Scan()
			chunks := strings.Split(sc.Text(), " ")
			x, _ := strconv.Atoi(chunks[0])
			y, _ := strconv.Atoi(chunks[1])
			m.Gems[i+1] = &Gem{ID: i + 1, Point: Point{X: x, Y: y}}
		}
		sc.Scan()
		opCnt, _ := strconv.Atoi(sc.Text())
		for i := 0; i < opCnt; i++ {
			sc.Scan()
			chunks := strings.Split(sc.Text(), " ")
			dir := chunks[0]
			v, _ := strconv.Atoi(chunks[1])
			m.Move(dir, v)
		}
		msg := "No"
		if m.HasCompleted() {
			msg = "Yes"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

set<PII> se;
void move(string c, int num, PII &p) {
    if (c == "N") {
        REP(i, num) {
            p.second++;
            if(FIND(se, p)) se.erase(p);
        }
    }
    if (c == "S") {
        REP(i, num) {
            p.second--;
            if(FIND(se, p)) se.erase(p);
        }
    }
    if (c == "W") {
        REP(i, num) {
            p.first--;
            if(FIND(se, p)) se.erase(p);
        }
    }
    if (c == "E") {
        REP(i, num) {
            p.first++;
            if(FIND(se, p)) se.erase(p);
        }
    }
}

void solve(int N) {
    REP(i, N) {
        int x, y;
        cin >> x >> y;
        se.insert(MP(x, y));
    }
    int M; cin >> M;
    PII robo = MP(10, 10);
    REP(i, M) {
        string c;
        int num;
        cin >> c >> num;
        move(c, num, robo);
    }
    if (se.size() == 0) {
        cout << "Yes" << endl;
    } else {
        cout << "No" <<endl;
    }
}

int main(void) {
    int n, p, m;
    string s;
    int a, b, c;
    while (cin >> n) {
        if (n == 0) return 0;
        solve(n);
        se.clear();
        //return 0;
    }
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

typedef pair<char, int>Command;//first:方向,second:長さ

//見つかった宝石はmapをfalseにする。
bool solve(int n, bool map[21][21], int m, Command *comlist){
	int count = 0;//見つかった宝石の個数
	int posx = 10;
	int posy = 10;
	for(int i=0;i<m;i++){
		for(int j=0;j<comlist[i].second;j++){//移動する回数
			switch(comlist[i].first){
			case 'N':
				posy++;
				break;
			case 'E':
				posx++;
				break;
			case 'S':
				posy--;
				break;
			case 'W':
				posx--;
				break;
			}
			if(map[posy][posx]==true){//宝石がある
				count++;
				map[posy][posx] = false;//回収して、そこに宝石がなくなった
			}
		}
	}
	if(count == n){//すべて見つけた
		return true;
	}else{
		return false;
	}
}

int main(){
	while(true){
		int n;
		cin >> n;
		if(n == 0){
			break;
		}
		bool map[21][21];//x,yともに[0,20]。trueの場所に宝石がある。
		//boolの初期値はtrue?false?
		for(int i=0;i<21;i++){
			for(int j=0;j<21;j++){
				map[i][j] = false;
			}
		}
		for(int i=0;i<n;i++){
			int x,y;
			cin >> x >> y;
			map[y][x] = true;
		}
		int m;//命令回数
		cin >> m;
		Command *comlist = new Command[m];
		for(int i=0;i<m;i++){
			cin >> comlist[i].first >> comlist[i].second;
		}
		bool result = solve(n,map,m,comlist);
		if(result==true){
			cout << "Yes" << endl;
		}else {
			cout << "No" << endl;
		}
		delete[] comlist;
	}
}

C++: #include<iostream>
#include<cstring>
using namespace std;

int main(){
	int x[100],y[100],t[100],s[100],cx,cy,sum;
	char d[100];
	int n,m;
	while(true){
		cin>>n;
		memset(t,0,sizeof(t));
		if(n==0){
			break;
		}
		
		for(int i=1;i<=n;i++){
			cin>>x[i]>>y[i];
			t[i]=1;
		}
		cx=10;
		cy=10;
		sum=0;
		cin>>m;

		for(int k=1;k<=m;k++){
			if((x[k]==cx && y[k]==cy) && t[k]==1){
				sum += 1;
				t[k]=0;
			}
		}

		for(int i=1;i<=m;i++){
			cin>>d[i]>>s[i];

			if(d[i]=='N'){
				for(int j=1;j<=s[i];j++){
					cy += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='E'){
				for(int j=1;j<=s[i];j++){
					cx += 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='S'){
				for(int j=1;j<=s[i];j++){
					cy -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}
			if(d[i]=='W'){
				for(int j=1;j<=s[i];j++){
					cx -= 1;
					for(int k=1;k<=m;k++){
						if((x[k]==cx && y[k]==cy) && t[k]==1){
							sum += 1;
							t[k]=0;
						}
					}
				}
			}

		}
		if(sum==n){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		int h[21][21];
		lp(i,21){
			lp(j,21){
				h[i][j]=0;
			}
		}
		lp(i,n){
			int a,b;
			cin>>a>>b;
			h[a][b]=1;
		}
		int m,count=0;
		cin>>m;
		int nowx=10,nowy=10;
		if(h[nowx][nowy]==1){
			count++;
			h[nowx][nowy]=0;
		}
		lp(i,m){
			char a;
			int b;
			cin>>a>>b;
			if(a=='N'){
				lp(j,b){
					nowy++;
					if(h[nowx][nowy]==1){
						h[nowx][nowy]=0;
						count++;
					}
				}
			}
			if(a=='S'){
				lp(j,b){
					nowy--;
					if(h[nowx][nowy]==1){
						h[nowx][nowy]=0;
						count++;
					}
				}
			}			
			if(a=='E'){
				lp(j,b){
					nowx++;
					if(h[nowx][nowy]==1){
						h[nowx][nowy]=0;
						count++;
					}
				}
			}
			if(a=='W'){
				lp(j,b){
					nowx--;
					if(h[nowx][nowy]==1){
						h[nowx][nowy]=0;
						count++;
					}
				}
			}
		}
		if(count==n)
			cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}