제출 #210436

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2104362020-03-17 10:58:20dennisstarCats or Dogs (JOI18_catdog)C++17
100 / 100
1101 ms21240 KiB
#include "catdog.h"
#include <bits/stdc++.h>
#define eb emplace_back
using namespace std;
const int MX = 100005, INF = 1<<28;
struct node {
int v[2][2];
node() { for (int i=0; i<2; i++) v[i][i]=0, v[i][i^1]=INF; }
node(int c, int d) { v[0][0]=c, v[0][1]=v[1][0]=INF, v[1][1]=d; }
};
node operator + (const node &n1, const node &n2) {
node r;
for (int i=0; i<2; i++) for (int j=0; j<2; j++) {
r.v[i][j]=INF;
for (int k=0; k<2; k++) for (int l=0; l<2; l++)
r.v[i][j]=min(r.v[i][j], n1.v[i][k]+n2.v[l][j]+(k^l));
}
return r;
}
int N, Q, sz[MX];
int P[MX], C[MX], D[MX], T[MX];
int in[MX], out[MX], hld[MX], hla[MX];
vector<int> adj[MX];
node st[1<<18];
void upd(int i, int s, int e, int t, int c, int d) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...