Submission #30050727
Source Code Expand
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 400010;
const int INF = 0x3f3f3f3f;
template <typename T> inline void read(T &x) {
x = 0; int f = 1; char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
x *= f;
}
struct Person {int x, y, dir;} p[N];
int n; char s[N];
inline bool cmp(Person a, Person b) {
return a.y == b.y ? a.x < b.x : a.y < b.y;
}
int main() {
read(n);
for (int i = 1; i <= n; ++ i)
read(p[i].x), read(p[i].y);
scanf("%s", s + 1);
for (int i = 1; i <= n; ++ i)
if (s[i] == 'L') p[i].dir = 0;
else p[i].dir = 1;
sort(p + 1, p + n + 1, cmp);
int now = 1, lst = -1, lt = 0, rt = 0;
while (now <= n) {
if (p[now].y != lst) lt = rt = 0, lst = p[now].y;
if (p[now].dir) ++ rt;
else if (rt) {puts("Yes"); return 0;}
++ now;
}
puts("No"); return (0 - 0);
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Collision 2 |
| User | Dfkuaid |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 1033 Byte |
| Status | AC |
| Exec Time | 47 ms |
| Memory | 6208 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:32:28: warning: variable ‘lt’ set but not used [-Wunused-but-set-variable]
32 | int now = 1, lst = -1, lt = 0, rt = 0;
| ^~
./Main.cpp:27:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
27 | scanf("%s", s + 1);
| ~~~~~^~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_in_rows_00.txt, 02_in_rows_01.txt, 02_in_rows_02.txt, 02_in_rows_03.txt, 02_in_rows_04.txt, 02_in_rows_05.txt, 02_in_rows_06.txt, 02_in_rows_07.txt, 02_in_rows_08.txt, 02_in_rows_09.txt, 02_in_rows_10.txt, 02_in_rows_11.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 5 ms | 3492 KiB |
| 00_sample_01.txt | AC | 2 ms | 3500 KiB |
| 00_sample_02.txt | AC | 2 ms | 3536 KiB |
| 01_random_00.txt | AC | 47 ms | 6136 KiB |
| 01_random_01.txt | AC | 44 ms | 6208 KiB |
| 01_random_02.txt | AC | 43 ms | 6132 KiB |
| 01_random_03.txt | AC | 42 ms | 6112 KiB |
| 02_in_rows_00.txt | AC | 40 ms | 6096 KiB |
| 02_in_rows_01.txt | AC | 43 ms | 6100 KiB |
| 02_in_rows_02.txt | AC | 43 ms | 6112 KiB |
| 02_in_rows_03.txt | AC | 42 ms | 6112 KiB |
| 02_in_rows_04.txt | AC | 43 ms | 6100 KiB |
| 02_in_rows_05.txt | AC | 43 ms | 6012 KiB |
| 02_in_rows_06.txt | AC | 42 ms | 6100 KiB |
| 02_in_rows_07.txt | AC | 42 ms | 6108 KiB |
| 02_in_rows_08.txt | AC | 44 ms | 6036 KiB |
| 02_in_rows_09.txt | AC | 42 ms | 6032 KiB |
| 02_in_rows_10.txt | AC | 44 ms | 6100 KiB |
| 02_in_rows_11.txt | AC | 42 ms | 6008 KiB |