답안 #528123

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
528123 2022-02-19T10:36:00 Z ainta From Hacks to Snitches (BOI21_watchmen) C++17
25 / 100
6000 ms 100508 KB
#include <bits/stdc++.h>
using namespace std;
 
 
namespace Rec{
    template<class Fun>
    class y_combinator_result {
        Fun fun_;
    public:
        template<class T>
        explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}
 
        template<class ...Args>
        decltype(auto) operator()(Args &&...args) {
            return fun_(std::ref(*this), std::forward<Args>(args)...);
        }
    };
 
    template<class Fun>
    decltype(auto) y_combinator(Fun &&fun) {
        return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
    }
}
 
 
//fast IO by yosupo
struct Scanner {
    FILE* fp = nullptr;
    char line[(1 << 15) + 1];
    size_t st = 0, ed = 0;
    void reread() {
        memmove(line, line + st, ed - st);
        ed -= st;
        st = 0;
        ed += fread(line + ed, 1, (1 << 15) - ed, fp);
        line[ed] = '\0';
    }
    bool succ() {
        while (true) {
            if (st == ed) {
                reread();
                if (st == ed) return false;
            }
            while (st != ed && isspace(line[st])) st++;
            if (st != ed) break;
        }
        if (ed - st <= 50) reread();
        return true;
    }
    template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
    bool read_single(T& ref) {
        if (!succ()) return false;
        while (true) {
            size_t sz = 0;
            while (st + sz < ed && !isspace(line[st + sz])) sz++;
            ref.append(line + st, sz);
            st += sz;
            if (!sz || st != ed) break;
            reread();            
        }
        return true;
    }
    template <class T, enable_if_t<is_integral<T>::value, int> = 0>
    bool read_single(T& ref) {
        if (!succ()) return false;
        bool neg = false;
        if (line[st] == '-') {
            neg = true;
            st++;
        }
        ref = T(0);
        while (isdigit(line[st])) {
            ref = 10 * ref + (line[st++] - '0');
        }
        if (neg) ref = -ref;
        return true;
    }
    template <class T> bool read_single(vector<T>& ref) {
        for (auto& d : ref) {
            if (!read_single(d)) return false;
        }
        return true;
    }
    void read() {}
    template <class H, class... T> void read(H& h, T&... t) {
        bool f = read_single(h);
        assert(f);
        read(t...);
    }
    Scanner(FILE* _fp) : fp(_fp) {}
};
 
struct Printer {
  public:
    template <bool F = false> void write() {}
    template <bool F = false, class H, class... T>
    void write(const H& h, const T&... t) {
        if (F) write_single(' ');
        write_single(h);
        write<true>(t...);
    }
    template <class... T> void writeln(const T&... t) {
        write(t...);
        write_single('\n');
    }
 
    Printer(FILE* _fp) : fp(_fp) {}
    ~Printer() { flush(); }
 
  private:
    static constexpr size_t SIZE = 1 << 15;
    FILE* fp;
    char line[SIZE], small[50];
    size_t pos = 0;
    void flush() {
        fwrite(line, 1, pos, fp);
        pos = 0;
    }
    void write_single(const char& val) {
        if (pos == SIZE) flush();
        line[pos++] = val;
    }
    template <class T, enable_if_t<is_integral<T>::value, int> = 0>
    void write_single(T val) {
        if (pos > (1 << 15) - 50) flush();
        if (val == 0) {
            write_single('0');
            return;
        }
        if (val < 0) {
            write_single('-');
            val = -val;  // todo min
        }
        size_t len = 0;
        while (val) {
            small[len++] = char('0' + (val % 10));
            val /= 10;
        }
        for (size_t i = 0; i < len; i++) {
            line[pos + i] = small[len - 1 - i];
        }
        pos += len;
    }
    void write_single(const string& s) {
        for (char c : s) write_single(c);
    }
    void write_single(const char* s) {
        size_t len = strlen(s);
        for (size_t i = 0; i < len; i++) write_single(s[i]);
    }
    template <class T> void write_single(const vector<T>& val) {
        auto n = val.size();
        for (size_t i = 0; i < n; i++) {
            if (i) write_single(' ');
            write_single(val[i]);
        }
    }
};
 
 
using ll=long long;
//#define int ll
 
#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define si(x) int(x.size())
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif
 
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
 
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
 
using pii=pair<int,int>;
using vi=vc<int>;
 
template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.a<<","<<p.b<<"}";
}
 
template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}
 
#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,-1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#ifdef LOCAL
void dmpr(ostream&os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
	os<<t<<" ";
	dmpr(os,args...);
}
#define dmp2(...) dmpr(cerr,__LINE__,##__VA_ARGS__)
#else
#define dmp2(...) void(0)
#endif
 
using uint=unsigned;
using ull=unsigned long long;
using pil=pair<int,ll>;
using pli=pair<ll,int>;
using pll=pair<ll,ll>;
 
template<class t,size_t n>
ostream& operator<<(ostream&os,const array<t,n>&a){
	return os<<vc<t>(all(a));
}
 
template<int i,class T>
void print_tuple(ostream&,const T&){
}
 
template<int i,class T,class H,class ...Args>
void print_tuple(ostream&os,const T&t){
	if(i)os<<",";
	os<<get<i>(t);
	print_tuple<i+1,T,Args...>(os,t);
}
 
template<class ...Args>
ostream& operator<<(ostream&os,const tuple<Args...>&t){
	os<<"{";
	print_tuple<0,tuple<Args...>,Args...>(os,t);
	return os<<"}";
}
 
template<class t>
void print(t x,int suc=1){
	cout<<x;
	if(suc==1)
		cout<<"\n";
	if(suc==2)
		cout<<" ";
}
 
ll read(){
	ll i;
	cin>>i;
	return i;
}
 
vi readvi(int n,int off=0){
	vi v(n);
	rep(i,n)v[i]=read()+off;
	return v;
}
 
template<class T>
void print(const vector<T>&v,int suc=1){
	rep(i,v.size())
		print(v[i],i==int(v.size())-1?suc:2);
}
 
string readString(){
	string s;
	cin>>s;
	return s;
}
 
template<class T>
T sq(const T& t){
	return t*t;
}
 
//#define CAPITAL
void yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<"\n";
	#else
	cout<<"Yes"<<"\n";
	#endif
	if(ex)exit(0);
}
void no(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<"\n";
	#else
	cout<<"No"<<"\n";
	#endif
	if(ex)exit(0);
}
void possible(bool ex=true){
	#ifdef CAPITAL
	cout<<"POSSIBLE"<<"\n";
	#else
	cout<<"Possible"<<"\n";
	#endif
	if(ex)exit(0);
}
void impossible(bool ex=true){
	#ifdef CAPITAL
	cout<<"IMPOSSIBLE"<<"\n";
	#else
	cout<<"Impossible"<<"\n";
	#endif
	if(ex)exit(0);
}
 
constexpr ll ten(int n){
	return n==0?1:ten(n-1)*10;
}
 
const ll infLL=LLONG_MAX/3;
 
#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif
 
int topbit(signed t){
	return t==0?-1:31-__builtin_clz(t);
}
int topbit(ll t){
	return t==0?-1:63-__builtin_clzll(t);
}
int botbit(signed a){
	return a==0?32:__builtin_ctz(a);
}
int botbit(ll a){
	return a==0?64:__builtin_ctzll(a);
}
int popcount(signed t){
	return __builtin_popcount(t);
}
int popcount(ll t){
	return __builtin_popcountll(t);
}
bool ispow2(int i){
	return i&&(i&-i)==i;
}
ll mask(int i){
	return (ll(1)<<i)-1;
}
 
template<class t>
bool inc(t a,t b,t c){
	return a<=b&&b<=c;
}
 
template<class t> void mkuni(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}
 
ll rand_int(ll l, ll r) { //[l, r]
	#ifdef LOCAL
	static mt19937_64 gen;
	#else
    static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
    #endif
    return uniform_int_distribution<ll>(l, r)(gen);
}
 
template<class t>
int lwb(const vc<t>&v,const t&a){
	return lower_bound(all(v),a)-v.bg;
}
 
struct modinfo{uint mod,root;};
template<modinfo const&ref>
struct modular{
	static constexpr uint const &mod=ref.mod;
	static modular root(){return modular(ref.root);}
	uint v;
	//modular(initializer_list<uint>ls):v(*ls.bg){}
	modular(ll vv=0){s(vv%mod+mod);}
	modular& s(uint vv){
		v=vv<mod?vv:vv-mod;
		return *this;
	}
	modular operator-()const{return modular()-*this;}
	modular& operator+=(const modular&rhs){return s(v+rhs.v);}
	modular&operator-=(const modular&rhs){return s(v+mod-rhs.v);}
	modular&operator*=(const modular&rhs){
		v=ull(v)*rhs.v%mod;
		return *this;
	}
	modular&operator/=(const modular&rhs){return *this*=rhs.inv();}
	modular operator+(const modular&rhs)const{return modular(*this)+=rhs;}
	modular operator-(const modular&rhs)const{return modular(*this)-=rhs;}
	modular operator*(const modular&rhs)const{return modular(*this)*=rhs;}
	modular operator/(const modular&rhs)const{return modular(*this)/=rhs;}
	modular pow(int n)const{
		modular res(1),x(*this);
		while(n){
			if(n&1)res*=x;
			x*=x;
			n>>=1;
		}
		return res;
	}
	modular inv()const{return pow(mod-2);}
	/*modular inv()const{
		int x,y;
		int g=extgcd(v,mod,x,y);
		assert(g==1);
		if(x<0)x+=mod;
		return modular(x);
	}*/
	friend modular operator+(int x,const modular&y){
		return modular(x)+y;
	}
	friend modular operator-(int x,const modular&y){
		return modular(x)-y;
	}
	friend modular operator*(int x,const modular&y){
		return modular(x)*y;
	}
	friend modular operator/(int x,const modular&y){
		return modular(x)/y;
	}
	friend ostream& operator<<(ostream&os,const modular&m){
		return os<<m.v;
	}
	friend istream& operator>>(istream&is,modular&m){
		ll x;is>>x;
		m=modular(x);
		return is;
	}
	bool operator<(const modular&r)const{return v<r.v;}
	bool operator==(const modular&r)const{return v==r.v;}
	bool operator!=(const modular&r)const{return v!=r.v;}
	explicit operator bool()const{
		return v;
	}
};
extern constexpr modinfo base{1000000007,0};
using mint=modular<base>;
#define N_ 251000
vi E[N_], G[N_];
bool vis[N_];
vc<int> D[N_];
int M[N_], F[N_], Num[N_];
int main(){
	
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	
	Scanner sc(stdin);
	Printer pr(stdout);

    int n, m;
    sc.read(n,m);
    rep(i,m){
        int a, b;
        sc.read(a,b);
        E[a].pb(b);
        E[b].pb(a);
    }
    int K;
    sc.read(K);
    rng(i,1,n){
        M[i]=1;
        F[i]=-1;
    }
    rep(i,K){
        int l;
        sc.read(l);
        vi w(l);
        rep(j,l){
            sc.read(w[j]);
            M[w[j]] = l;
            F[w[j]] = j;
            Num[w[j]] = i+1;
        }
    }
    rng(i,1,n){
        D[i].resize(M[i]);
        rep(j,M[i]){
            D[i][j] = 1e9;
        }
    }
    rng(i,1,n){
        for(auto &x: E[i]){
            if(M[x]!=1)G[i].pb(x);
        }
    }
    priority_queue<pii>PQ;
    auto Put = [&](int a, int d) -> void {
        //printf("%d %d\n",a,d);
        if(D[a][d%M[a]] <= d)return;
        D[a][d%M[a]] = d;
        PQ.push({-d,a});
    };
    Put(1,0);
    auto Go = [&](int a, int d, vi &T) -> void{

        if(F[a] != (d+1)%M[a]){
            Put(a,d+1);
        }
        if(M[a] == 1){
            for(auto &x: T){
                if(M[x]==1){
                    Put(x,d+1);
                    continue;
                }
                if(F[x] == (d+1)%M[x]){
                    Put(x,d+2);
                }
                else{
                    Put(x,d+1);
                    int t = d/M[x]*M[x] + F[x] + 1;
                    while(t < d+1) t += M[x];
                    Put(x,t);
                }
            }
            return;
        }
        for(auto &x: T){
            if(Num[a] == Num[x]){
                int Mod = M[a];
                if(F[a] == (d+1)%Mod && F[x] == d%Mod)continue;
                if(F[x] == (d+1)%Mod){
                    if(F[a] != (d+2)%Mod) Put(x,d+2);
                }
                else Put(x,d+1);
            }
            else{
                rep(j,M[x]){
                    Put(x,d +j*M[a]+1);
                }
            }
        }
    };
    while(!PQ.empty()){
        auto [d,a] = PQ.top();
        PQ.pop();
        d = -d;
        if(D[a][d%M[a]] != d)continue;

        if(!vis[a]){
            Go(a, d, E[a]);
            vis[a] = 1;
        }
        else{
            Go(a, d, G[a]);
        }
    }
    int res = 1e9;
    rep(i,M[n]){
        res=min(res,D[n][i]);
    }
    if(res>8e8)puts("impossible");
    else printf("%d\n",res);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 19148 KB Output is correct
2 Correct 64 ms 25540 KB Output is correct
3 Correct 60 ms 24960 KB Output is correct
4 Correct 80 ms 25212 KB Output is correct
5 Correct 11 ms 18124 KB Output is correct
6 Correct 60 ms 24900 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 33 ms 19228 KB Output is correct
2 Correct 63 ms 25544 KB Output is correct
3 Correct 77 ms 24896 KB Output is correct
4 Correct 82 ms 25252 KB Output is correct
5 Correct 11 ms 18092 KB Output is correct
6 Correct 62 ms 24900 KB Output is correct
7 Correct 56 ms 24840 KB Output is correct
8 Correct 61 ms 24828 KB Output is correct
9 Correct 57 ms 24860 KB Output is correct
10 Correct 79 ms 25332 KB Output is correct
11 Correct 57 ms 25160 KB Output is correct
12 Correct 57 ms 24900 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 33 ms 19228 KB Output is correct
2 Correct 63 ms 25544 KB Output is correct
3 Correct 77 ms 24896 KB Output is correct
4 Correct 82 ms 25252 KB Output is correct
5 Correct 11 ms 18092 KB Output is correct
6 Correct 62 ms 24900 KB Output is correct
7 Correct 56 ms 24840 KB Output is correct
8 Correct 61 ms 24828 KB Output is correct
9 Correct 57 ms 24860 KB Output is correct
10 Correct 79 ms 25332 KB Output is correct
11 Correct 57 ms 25160 KB Output is correct
12 Correct 57 ms 24900 KB Output is correct
13 Correct 33 ms 19192 KB Output is correct
14 Correct 65 ms 25548 KB Output is correct
15 Correct 67 ms 24964 KB Output is correct
16 Correct 78 ms 25208 KB Output is correct
17 Correct 11 ms 18164 KB Output is correct
18 Correct 58 ms 24876 KB Output is correct
19 Correct 55 ms 24808 KB Output is correct
20 Correct 54 ms 24836 KB Output is correct
21 Correct 54 ms 24900 KB Output is correct
22 Correct 61 ms 25300 KB Output is correct
23 Correct 58 ms 25164 KB Output is correct
24 Correct 57 ms 24840 KB Output is correct
25 Correct 857 ms 68424 KB Output is correct
26 Correct 800 ms 72928 KB Output is correct
27 Correct 733 ms 68820 KB Output is correct
28 Correct 639 ms 72800 KB Output is correct
29 Correct 915 ms 80784 KB Output is correct
30 Correct 946 ms 83316 KB Output is correct
31 Correct 952 ms 72544 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 33 ms 19228 KB Output is correct
2 Correct 63 ms 25544 KB Output is correct
3 Correct 77 ms 24896 KB Output is correct
4 Correct 82 ms 25252 KB Output is correct
5 Correct 11 ms 18092 KB Output is correct
6 Correct 62 ms 24900 KB Output is correct
7 Correct 56 ms 24840 KB Output is correct
8 Correct 61 ms 24828 KB Output is correct
9 Correct 57 ms 24860 KB Output is correct
10 Correct 79 ms 25332 KB Output is correct
11 Correct 57 ms 25160 KB Output is correct
12 Correct 57 ms 24900 KB Output is correct
13 Correct 33 ms 19192 KB Output is correct
14 Correct 65 ms 25548 KB Output is correct
15 Correct 67 ms 24964 KB Output is correct
16 Correct 78 ms 25208 KB Output is correct
17 Correct 11 ms 18164 KB Output is correct
18 Correct 58 ms 24876 KB Output is correct
19 Correct 55 ms 24808 KB Output is correct
20 Correct 54 ms 24836 KB Output is correct
21 Correct 54 ms 24900 KB Output is correct
22 Correct 61 ms 25300 KB Output is correct
23 Correct 58 ms 25164 KB Output is correct
24 Correct 57 ms 24840 KB Output is correct
25 Correct 857 ms 68424 KB Output is correct
26 Correct 800 ms 72928 KB Output is correct
27 Correct 733 ms 68820 KB Output is correct
28 Correct 639 ms 72800 KB Output is correct
29 Correct 915 ms 80784 KB Output is correct
30 Correct 946 ms 83316 KB Output is correct
31 Correct 952 ms 72544 KB Output is correct
32 Correct 34 ms 19148 KB Output is correct
33 Correct 63 ms 25548 KB Output is correct
34 Correct 61 ms 24924 KB Output is correct
35 Correct 88 ms 25156 KB Output is correct
36 Correct 11 ms 18124 KB Output is correct
37 Correct 58 ms 24940 KB Output is correct
38 Correct 55 ms 24928 KB Output is correct
39 Correct 56 ms 24900 KB Output is correct
40 Correct 55 ms 24836 KB Output is correct
41 Correct 72 ms 25284 KB Output is correct
42 Correct 59 ms 25160 KB Output is correct
43 Correct 62 ms 24808 KB Output is correct
44 Correct 867 ms 68564 KB Output is correct
45 Correct 813 ms 72896 KB Output is correct
46 Correct 765 ms 68980 KB Output is correct
47 Correct 618 ms 72768 KB Output is correct
48 Correct 920 ms 80820 KB Output is correct
49 Correct 937 ms 83304 KB Output is correct
50 Correct 968 ms 72572 KB Output is correct
51 Correct 1295 ms 77452 KB Output is correct
52 Correct 1496 ms 88032 KB Output is correct
53 Correct 1234 ms 78156 KB Output is correct
54 Correct 591 ms 64400 KB Output is correct
55 Execution timed out 6076 ms 100508 KB Time limit exceeded
56 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 19148 KB Output is correct
2 Correct 64 ms 25540 KB Output is correct
3 Correct 60 ms 24960 KB Output is correct
4 Correct 80 ms 25212 KB Output is correct
5 Correct 11 ms 18124 KB Output is correct
6 Correct 60 ms 24900 KB Output is correct
7 Correct 33 ms 19228 KB Output is correct
8 Correct 63 ms 25544 KB Output is correct
9 Correct 77 ms 24896 KB Output is correct
10 Correct 82 ms 25252 KB Output is correct
11 Correct 11 ms 18092 KB Output is correct
12 Correct 62 ms 24900 KB Output is correct
13 Correct 56 ms 24840 KB Output is correct
14 Correct 61 ms 24828 KB Output is correct
15 Correct 57 ms 24860 KB Output is correct
16 Correct 79 ms 25332 KB Output is correct
17 Correct 57 ms 25160 KB Output is correct
18 Correct 57 ms 24900 KB Output is correct
19 Correct 9 ms 17996 KB Output is correct
20 Correct 9 ms 18088 KB Output is correct
21 Incorrect 10 ms 18000 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 19148 KB Output is correct
2 Correct 64 ms 25540 KB Output is correct
3 Correct 60 ms 24960 KB Output is correct
4 Correct 80 ms 25212 KB Output is correct
5 Correct 11 ms 18124 KB Output is correct
6 Correct 60 ms 24900 KB Output is correct
7 Correct 33 ms 19228 KB Output is correct
8 Correct 63 ms 25544 KB Output is correct
9 Correct 77 ms 24896 KB Output is correct
10 Correct 82 ms 25252 KB Output is correct
11 Correct 11 ms 18092 KB Output is correct
12 Correct 62 ms 24900 KB Output is correct
13 Correct 56 ms 24840 KB Output is correct
14 Correct 61 ms 24828 KB Output is correct
15 Correct 57 ms 24860 KB Output is correct
16 Correct 79 ms 25332 KB Output is correct
17 Correct 57 ms 25160 KB Output is correct
18 Correct 57 ms 24900 KB Output is correct
19 Correct 33 ms 19192 KB Output is correct
20 Correct 65 ms 25548 KB Output is correct
21 Correct 67 ms 24964 KB Output is correct
22 Correct 78 ms 25208 KB Output is correct
23 Correct 11 ms 18164 KB Output is correct
24 Correct 58 ms 24876 KB Output is correct
25 Correct 55 ms 24808 KB Output is correct
26 Correct 54 ms 24836 KB Output is correct
27 Correct 54 ms 24900 KB Output is correct
28 Correct 61 ms 25300 KB Output is correct
29 Correct 58 ms 25164 KB Output is correct
30 Correct 57 ms 24840 KB Output is correct
31 Correct 857 ms 68424 KB Output is correct
32 Correct 800 ms 72928 KB Output is correct
33 Correct 733 ms 68820 KB Output is correct
34 Correct 639 ms 72800 KB Output is correct
35 Correct 915 ms 80784 KB Output is correct
36 Correct 946 ms 83316 KB Output is correct
37 Correct 952 ms 72544 KB Output is correct
38 Correct 9 ms 17996 KB Output is correct
39 Correct 9 ms 18088 KB Output is correct
40 Incorrect 10 ms 18000 KB Output isn't correct
41 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 19148 KB Output is correct
2 Correct 64 ms 25540 KB Output is correct
3 Correct 60 ms 24960 KB Output is correct
4 Correct 80 ms 25212 KB Output is correct
5 Correct 11 ms 18124 KB Output is correct
6 Correct 60 ms 24900 KB Output is correct
7 Correct 33 ms 19228 KB Output is correct
8 Correct 63 ms 25544 KB Output is correct
9 Correct 77 ms 24896 KB Output is correct
10 Correct 82 ms 25252 KB Output is correct
11 Correct 11 ms 18092 KB Output is correct
12 Correct 62 ms 24900 KB Output is correct
13 Correct 56 ms 24840 KB Output is correct
14 Correct 61 ms 24828 KB Output is correct
15 Correct 57 ms 24860 KB Output is correct
16 Correct 79 ms 25332 KB Output is correct
17 Correct 57 ms 25160 KB Output is correct
18 Correct 57 ms 24900 KB Output is correct
19 Correct 33 ms 19192 KB Output is correct
20 Correct 65 ms 25548 KB Output is correct
21 Correct 67 ms 24964 KB Output is correct
22 Correct 78 ms 25208 KB Output is correct
23 Correct 11 ms 18164 KB Output is correct
24 Correct 58 ms 24876 KB Output is correct
25 Correct 55 ms 24808 KB Output is correct
26 Correct 54 ms 24836 KB Output is correct
27 Correct 54 ms 24900 KB Output is correct
28 Correct 61 ms 25300 KB Output is correct
29 Correct 58 ms 25164 KB Output is correct
30 Correct 57 ms 24840 KB Output is correct
31 Correct 857 ms 68424 KB Output is correct
32 Correct 800 ms 72928 KB Output is correct
33 Correct 733 ms 68820 KB Output is correct
34 Correct 639 ms 72800 KB Output is correct
35 Correct 915 ms 80784 KB Output is correct
36 Correct 946 ms 83316 KB Output is correct
37 Correct 952 ms 72544 KB Output is correct
38 Correct 34 ms 19148 KB Output is correct
39 Correct 63 ms 25548 KB Output is correct
40 Correct 61 ms 24924 KB Output is correct
41 Correct 88 ms 25156 KB Output is correct
42 Correct 11 ms 18124 KB Output is correct
43 Correct 58 ms 24940 KB Output is correct
44 Correct 55 ms 24928 KB Output is correct
45 Correct 56 ms 24900 KB Output is correct
46 Correct 55 ms 24836 KB Output is correct
47 Correct 72 ms 25284 KB Output is correct
48 Correct 59 ms 25160 KB Output is correct
49 Correct 62 ms 24808 KB Output is correct
50 Correct 867 ms 68564 KB Output is correct
51 Correct 813 ms 72896 KB Output is correct
52 Correct 765 ms 68980 KB Output is correct
53 Correct 618 ms 72768 KB Output is correct
54 Correct 920 ms 80820 KB Output is correct
55 Correct 937 ms 83304 KB Output is correct
56 Correct 968 ms 72572 KB Output is correct
57 Correct 1295 ms 77452 KB Output is correct
58 Correct 1496 ms 88032 KB Output is correct
59 Correct 1234 ms 78156 KB Output is correct
60 Correct 591 ms 64400 KB Output is correct
61 Execution timed out 6076 ms 100508 KB Time limit exceeded
62 Halted 0 ms 0 KB -