Submission #466300

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4663002021-08-18 13:31:31NamnamseoLand of the Rainbow Gold (APIO17_rainbow)C++17
100 / 100
838 ms120080 KiB
#include "rainbow.h"
#include <algorithm>
#include <vector>
#include <tuple>
#define x first
#define y second
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define sort_and_unique(v) { sort(all(v)); v.erase(unique(all(v)), v.end()); }
using namespace std;
using pp=pair<int,int>;
using ll=long long;
const int maxm = int(1e5) + 10;
vector<pp> riv, eh, ev, e4;
void River(int sx, int sy, int m, char *s) {
riv.resize(m+1);
for (int i=0; i<m; ++i) {
riv[i] = {sx, sy};
if (s[i] == 'S') ++sx; else if (s[i] == 'N') --sx;
else if (s[i] == 'E') ++sy; else --sy;
}
riv[m++] = {sx, sy};
sort_and_unique(riv); m = riv.size();
eh = riv; ev = riv; eh.resize(2*m); ev.resize(2*m);
for (int i=0, x, y; i<m; ++i) { tie(x, y) = riv[i];
eh[m+i] = {x, y-1}; ev[m+i] = {x-1, y};
}
sort_and_unique(eh); sort_and_unique(ev);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...