#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define pb push_back
#define mp make_pair
#define rept(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define vec vector
#define all(x) (x).begin(), (x).end()
#define fs first
#define sc second
#define sum(x) (x).fs + (x).sc
#define diff(x) (x).fs - (x).sc
typedef long long ll;
typedef vec<int> vi;
typedef vec<vi> v2i;
typedef pair<ll, ll> pl;
typedef pair<int, int> pi;
typedef vec<pl> vpl;
typedef vec<pi> vpi;
typedef vec<bool> vb;
//sub 1
ll ct(pl c1, pl c2, pi d1, pi d2) {
pi rel = {d1.fs - d2.fs, d1.sc - d2.sc};
ll t = (c2.fs - c1.fs) / rel.fs;
if (c1.fs + t*rel.fs == c2.fs && c1.sc + t*rel.sc == c2.sc) return t;
return 0;
}
void sub1(int n, vpl& c, vpi& d) {
if (ct(c[0], c[1], d[0], d[1]) == 0) {
cout << "1 2 \n";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vpl c(n);
vpi d(n);
rep(i,n) {
char dir;
cin >> c[i].first >> c[i].second >> dir;
if (dir=='N') d[i] = {-1, 0};
if (dir=='E') d[i] = {0, 1};
if (dir=='S') d[i] = {1, 0};
if (dir=='W') d[i] = {0, -1};
}
if (n==2) sub1(n, c, d);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |