#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];
//printf("%d %d %d %d %d\n",a,x,d,F[a],F[x]);
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{
if(F[x] != (d+1)%M[x]){
Put(x,d+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 |
41 ms |
19740 KB |
Output is correct |
2 |
Correct |
83 ms |
26260 KB |
Output is correct |
3 |
Correct |
62 ms |
25540 KB |
Output is correct |
4 |
Correct |
86 ms |
25848 KB |
Output is correct |
5 |
Correct |
10 ms |
18080 KB |
Output is correct |
6 |
Correct |
64 ms |
25548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
19792 KB |
Output is correct |
2 |
Correct |
73 ms |
26380 KB |
Output is correct |
3 |
Correct |
71 ms |
25728 KB |
Output is correct |
4 |
Correct |
92 ms |
25944 KB |
Output is correct |
5 |
Correct |
11 ms |
18124 KB |
Output is correct |
6 |
Correct |
63 ms |
25636 KB |
Output is correct |
7 |
Correct |
60 ms |
25520 KB |
Output is correct |
8 |
Correct |
69 ms |
25632 KB |
Output is correct |
9 |
Correct |
66 ms |
25536 KB |
Output is correct |
10 |
Correct |
64 ms |
25924 KB |
Output is correct |
11 |
Correct |
79 ms |
25836 KB |
Output is correct |
12 |
Correct |
61 ms |
25628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
19792 KB |
Output is correct |
2 |
Correct |
73 ms |
26380 KB |
Output is correct |
3 |
Correct |
71 ms |
25728 KB |
Output is correct |
4 |
Correct |
92 ms |
25944 KB |
Output is correct |
5 |
Correct |
11 ms |
18124 KB |
Output is correct |
6 |
Correct |
63 ms |
25636 KB |
Output is correct |
7 |
Correct |
60 ms |
25520 KB |
Output is correct |
8 |
Correct |
69 ms |
25632 KB |
Output is correct |
9 |
Correct |
66 ms |
25536 KB |
Output is correct |
10 |
Correct |
64 ms |
25924 KB |
Output is correct |
11 |
Correct |
79 ms |
25836 KB |
Output is correct |
12 |
Correct |
61 ms |
25628 KB |
Output is correct |
13 |
Correct |
37 ms |
19752 KB |
Output is correct |
14 |
Correct |
74 ms |
26148 KB |
Output is correct |
15 |
Correct |
85 ms |
25596 KB |
Output is correct |
16 |
Correct |
98 ms |
25928 KB |
Output is correct |
17 |
Correct |
16 ms |
18176 KB |
Output is correct |
18 |
Correct |
69 ms |
25540 KB |
Output is correct |
19 |
Correct |
62 ms |
25660 KB |
Output is correct |
20 |
Correct |
58 ms |
25532 KB |
Output is correct |
21 |
Correct |
76 ms |
25580 KB |
Output is correct |
22 |
Correct |
77 ms |
25888 KB |
Output is correct |
23 |
Correct |
67 ms |
25816 KB |
Output is correct |
24 |
Correct |
61 ms |
25536 KB |
Output is correct |
25 |
Correct |
1004 ms |
69844 KB |
Output is correct |
26 |
Correct |
916 ms |
74228 KB |
Output is correct |
27 |
Correct |
873 ms |
71128 KB |
Output is correct |
28 |
Correct |
707 ms |
75976 KB |
Output is correct |
29 |
Correct |
1008 ms |
82196 KB |
Output is correct |
30 |
Correct |
1053 ms |
86868 KB |
Output is correct |
31 |
Correct |
1038 ms |
73564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
19792 KB |
Output is correct |
2 |
Correct |
73 ms |
26380 KB |
Output is correct |
3 |
Correct |
71 ms |
25728 KB |
Output is correct |
4 |
Correct |
92 ms |
25944 KB |
Output is correct |
5 |
Correct |
11 ms |
18124 KB |
Output is correct |
6 |
Correct |
63 ms |
25636 KB |
Output is correct |
7 |
Correct |
60 ms |
25520 KB |
Output is correct |
8 |
Correct |
69 ms |
25632 KB |
Output is correct |
9 |
Correct |
66 ms |
25536 KB |
Output is correct |
10 |
Correct |
64 ms |
25924 KB |
Output is correct |
11 |
Correct |
79 ms |
25836 KB |
Output is correct |
12 |
Correct |
61 ms |
25628 KB |
Output is correct |
13 |
Correct |
37 ms |
19752 KB |
Output is correct |
14 |
Correct |
74 ms |
26148 KB |
Output is correct |
15 |
Correct |
85 ms |
25596 KB |
Output is correct |
16 |
Correct |
98 ms |
25928 KB |
Output is correct |
17 |
Correct |
16 ms |
18176 KB |
Output is correct |
18 |
Correct |
69 ms |
25540 KB |
Output is correct |
19 |
Correct |
62 ms |
25660 KB |
Output is correct |
20 |
Correct |
58 ms |
25532 KB |
Output is correct |
21 |
Correct |
76 ms |
25580 KB |
Output is correct |
22 |
Correct |
77 ms |
25888 KB |
Output is correct |
23 |
Correct |
67 ms |
25816 KB |
Output is correct |
24 |
Correct |
61 ms |
25536 KB |
Output is correct |
25 |
Correct |
1004 ms |
69844 KB |
Output is correct |
26 |
Correct |
916 ms |
74228 KB |
Output is correct |
27 |
Correct |
873 ms |
71128 KB |
Output is correct |
28 |
Correct |
707 ms |
75976 KB |
Output is correct |
29 |
Correct |
1008 ms |
82196 KB |
Output is correct |
30 |
Correct |
1053 ms |
86868 KB |
Output is correct |
31 |
Correct |
1038 ms |
73564 KB |
Output is correct |
32 |
Correct |
37 ms |
19752 KB |
Output is correct |
33 |
Correct |
79 ms |
26244 KB |
Output is correct |
34 |
Correct |
77 ms |
25600 KB |
Output is correct |
35 |
Correct |
88 ms |
25948 KB |
Output is correct |
36 |
Correct |
10 ms |
18124 KB |
Output is correct |
37 |
Correct |
65 ms |
25588 KB |
Output is correct |
38 |
Correct |
73 ms |
25568 KB |
Output is correct |
39 |
Correct |
62 ms |
25680 KB |
Output is correct |
40 |
Correct |
82 ms |
25584 KB |
Output is correct |
41 |
Correct |
89 ms |
25984 KB |
Output is correct |
42 |
Correct |
65 ms |
25876 KB |
Output is correct |
43 |
Correct |
81 ms |
25664 KB |
Output is correct |
44 |
Correct |
1000 ms |
69704 KB |
Output is correct |
45 |
Correct |
1000 ms |
74216 KB |
Output is correct |
46 |
Correct |
868 ms |
70056 KB |
Output is correct |
47 |
Correct |
722 ms |
74052 KB |
Output is correct |
48 |
Correct |
973 ms |
82004 KB |
Output is correct |
49 |
Correct |
1130 ms |
84328 KB |
Output is correct |
50 |
Correct |
1059 ms |
73572 KB |
Output is correct |
51 |
Correct |
1444 ms |
78568 KB |
Output is correct |
52 |
Correct |
1619 ms |
88748 KB |
Output is correct |
53 |
Correct |
1539 ms |
82284 KB |
Output is correct |
54 |
Correct |
740 ms |
65424 KB |
Output is correct |
55 |
Execution timed out |
6102 ms |
101528 KB |
Time limit exceeded |
56 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
41 ms |
19740 KB |
Output is correct |
2 |
Correct |
83 ms |
26260 KB |
Output is correct |
3 |
Correct |
62 ms |
25540 KB |
Output is correct |
4 |
Correct |
86 ms |
25848 KB |
Output is correct |
5 |
Correct |
10 ms |
18080 KB |
Output is correct |
6 |
Correct |
64 ms |
25548 KB |
Output is correct |
7 |
Correct |
34 ms |
19792 KB |
Output is correct |
8 |
Correct |
73 ms |
26380 KB |
Output is correct |
9 |
Correct |
71 ms |
25728 KB |
Output is correct |
10 |
Correct |
92 ms |
25944 KB |
Output is correct |
11 |
Correct |
11 ms |
18124 KB |
Output is correct |
12 |
Correct |
63 ms |
25636 KB |
Output is correct |
13 |
Correct |
60 ms |
25520 KB |
Output is correct |
14 |
Correct |
69 ms |
25632 KB |
Output is correct |
15 |
Correct |
66 ms |
25536 KB |
Output is correct |
16 |
Correct |
64 ms |
25924 KB |
Output is correct |
17 |
Correct |
79 ms |
25836 KB |
Output is correct |
18 |
Correct |
61 ms |
25628 KB |
Output is correct |
19 |
Correct |
9 ms |
17996 KB |
Output is correct |
20 |
Correct |
9 ms |
18060 KB |
Output is correct |
21 |
Correct |
10 ms |
18060 KB |
Output is correct |
22 |
Correct |
36 ms |
19760 KB |
Output is correct |
23 |
Correct |
67 ms |
26180 KB |
Output is correct |
24 |
Correct |
66 ms |
25584 KB |
Output is correct |
25 |
Correct |
91 ms |
26052 KB |
Output is correct |
26 |
Correct |
13 ms |
18124 KB |
Output is correct |
27 |
Correct |
63 ms |
25636 KB |
Output is correct |
28 |
Correct |
61 ms |
25528 KB |
Output is correct |
29 |
Correct |
63 ms |
25592 KB |
Output is correct |
30 |
Correct |
59 ms |
25540 KB |
Output is correct |
31 |
Correct |
70 ms |
25988 KB |
Output is correct |
32 |
Correct |
59 ms |
25812 KB |
Output is correct |
33 |
Correct |
81 ms |
25636 KB |
Output is correct |
34 |
Correct |
980 ms |
72120 KB |
Output is correct |
35 |
Correct |
1006 ms |
66908 KB |
Output is correct |
36 |
Correct |
1032 ms |
66364 KB |
Output is correct |
37 |
Incorrect |
889 ms |
73972 KB |
Output isn't correct |
38 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
41 ms |
19740 KB |
Output is correct |
2 |
Correct |
83 ms |
26260 KB |
Output is correct |
3 |
Correct |
62 ms |
25540 KB |
Output is correct |
4 |
Correct |
86 ms |
25848 KB |
Output is correct |
5 |
Correct |
10 ms |
18080 KB |
Output is correct |
6 |
Correct |
64 ms |
25548 KB |
Output is correct |
7 |
Correct |
34 ms |
19792 KB |
Output is correct |
8 |
Correct |
73 ms |
26380 KB |
Output is correct |
9 |
Correct |
71 ms |
25728 KB |
Output is correct |
10 |
Correct |
92 ms |
25944 KB |
Output is correct |
11 |
Correct |
11 ms |
18124 KB |
Output is correct |
12 |
Correct |
63 ms |
25636 KB |
Output is correct |
13 |
Correct |
60 ms |
25520 KB |
Output is correct |
14 |
Correct |
69 ms |
25632 KB |
Output is correct |
15 |
Correct |
66 ms |
25536 KB |
Output is correct |
16 |
Correct |
64 ms |
25924 KB |
Output is correct |
17 |
Correct |
79 ms |
25836 KB |
Output is correct |
18 |
Correct |
61 ms |
25628 KB |
Output is correct |
19 |
Correct |
37 ms |
19752 KB |
Output is correct |
20 |
Correct |
74 ms |
26148 KB |
Output is correct |
21 |
Correct |
85 ms |
25596 KB |
Output is correct |
22 |
Correct |
98 ms |
25928 KB |
Output is correct |
23 |
Correct |
16 ms |
18176 KB |
Output is correct |
24 |
Correct |
69 ms |
25540 KB |
Output is correct |
25 |
Correct |
62 ms |
25660 KB |
Output is correct |
26 |
Correct |
58 ms |
25532 KB |
Output is correct |
27 |
Correct |
76 ms |
25580 KB |
Output is correct |
28 |
Correct |
77 ms |
25888 KB |
Output is correct |
29 |
Correct |
67 ms |
25816 KB |
Output is correct |
30 |
Correct |
61 ms |
25536 KB |
Output is correct |
31 |
Correct |
1004 ms |
69844 KB |
Output is correct |
32 |
Correct |
916 ms |
74228 KB |
Output is correct |
33 |
Correct |
873 ms |
71128 KB |
Output is correct |
34 |
Correct |
707 ms |
75976 KB |
Output is correct |
35 |
Correct |
1008 ms |
82196 KB |
Output is correct |
36 |
Correct |
1053 ms |
86868 KB |
Output is correct |
37 |
Correct |
1038 ms |
73564 KB |
Output is correct |
38 |
Correct |
9 ms |
17996 KB |
Output is correct |
39 |
Correct |
9 ms |
18060 KB |
Output is correct |
40 |
Correct |
10 ms |
18060 KB |
Output is correct |
41 |
Correct |
36 ms |
19760 KB |
Output is correct |
42 |
Correct |
67 ms |
26180 KB |
Output is correct |
43 |
Correct |
66 ms |
25584 KB |
Output is correct |
44 |
Correct |
91 ms |
26052 KB |
Output is correct |
45 |
Correct |
13 ms |
18124 KB |
Output is correct |
46 |
Correct |
63 ms |
25636 KB |
Output is correct |
47 |
Correct |
61 ms |
25528 KB |
Output is correct |
48 |
Correct |
63 ms |
25592 KB |
Output is correct |
49 |
Correct |
59 ms |
25540 KB |
Output is correct |
50 |
Correct |
70 ms |
25988 KB |
Output is correct |
51 |
Correct |
59 ms |
25812 KB |
Output is correct |
52 |
Correct |
81 ms |
25636 KB |
Output is correct |
53 |
Correct |
980 ms |
72120 KB |
Output is correct |
54 |
Correct |
1006 ms |
66908 KB |
Output is correct |
55 |
Correct |
1032 ms |
66364 KB |
Output is correct |
56 |
Incorrect |
889 ms |
73972 KB |
Output isn't correct |
57 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
41 ms |
19740 KB |
Output is correct |
2 |
Correct |
83 ms |
26260 KB |
Output is correct |
3 |
Correct |
62 ms |
25540 KB |
Output is correct |
4 |
Correct |
86 ms |
25848 KB |
Output is correct |
5 |
Correct |
10 ms |
18080 KB |
Output is correct |
6 |
Correct |
64 ms |
25548 KB |
Output is correct |
7 |
Correct |
34 ms |
19792 KB |
Output is correct |
8 |
Correct |
73 ms |
26380 KB |
Output is correct |
9 |
Correct |
71 ms |
25728 KB |
Output is correct |
10 |
Correct |
92 ms |
25944 KB |
Output is correct |
11 |
Correct |
11 ms |
18124 KB |
Output is correct |
12 |
Correct |
63 ms |
25636 KB |
Output is correct |
13 |
Correct |
60 ms |
25520 KB |
Output is correct |
14 |
Correct |
69 ms |
25632 KB |
Output is correct |
15 |
Correct |
66 ms |
25536 KB |
Output is correct |
16 |
Correct |
64 ms |
25924 KB |
Output is correct |
17 |
Correct |
79 ms |
25836 KB |
Output is correct |
18 |
Correct |
61 ms |
25628 KB |
Output is correct |
19 |
Correct |
37 ms |
19752 KB |
Output is correct |
20 |
Correct |
74 ms |
26148 KB |
Output is correct |
21 |
Correct |
85 ms |
25596 KB |
Output is correct |
22 |
Correct |
98 ms |
25928 KB |
Output is correct |
23 |
Correct |
16 ms |
18176 KB |
Output is correct |
24 |
Correct |
69 ms |
25540 KB |
Output is correct |
25 |
Correct |
62 ms |
25660 KB |
Output is correct |
26 |
Correct |
58 ms |
25532 KB |
Output is correct |
27 |
Correct |
76 ms |
25580 KB |
Output is correct |
28 |
Correct |
77 ms |
25888 KB |
Output is correct |
29 |
Correct |
67 ms |
25816 KB |
Output is correct |
30 |
Correct |
61 ms |
25536 KB |
Output is correct |
31 |
Correct |
1004 ms |
69844 KB |
Output is correct |
32 |
Correct |
916 ms |
74228 KB |
Output is correct |
33 |
Correct |
873 ms |
71128 KB |
Output is correct |
34 |
Correct |
707 ms |
75976 KB |
Output is correct |
35 |
Correct |
1008 ms |
82196 KB |
Output is correct |
36 |
Correct |
1053 ms |
86868 KB |
Output is correct |
37 |
Correct |
1038 ms |
73564 KB |
Output is correct |
38 |
Correct |
37 ms |
19752 KB |
Output is correct |
39 |
Correct |
79 ms |
26244 KB |
Output is correct |
40 |
Correct |
77 ms |
25600 KB |
Output is correct |
41 |
Correct |
88 ms |
25948 KB |
Output is correct |
42 |
Correct |
10 ms |
18124 KB |
Output is correct |
43 |
Correct |
65 ms |
25588 KB |
Output is correct |
44 |
Correct |
73 ms |
25568 KB |
Output is correct |
45 |
Correct |
62 ms |
25680 KB |
Output is correct |
46 |
Correct |
82 ms |
25584 KB |
Output is correct |
47 |
Correct |
89 ms |
25984 KB |
Output is correct |
48 |
Correct |
65 ms |
25876 KB |
Output is correct |
49 |
Correct |
81 ms |
25664 KB |
Output is correct |
50 |
Correct |
1000 ms |
69704 KB |
Output is correct |
51 |
Correct |
1000 ms |
74216 KB |
Output is correct |
52 |
Correct |
868 ms |
70056 KB |
Output is correct |
53 |
Correct |
722 ms |
74052 KB |
Output is correct |
54 |
Correct |
973 ms |
82004 KB |
Output is correct |
55 |
Correct |
1130 ms |
84328 KB |
Output is correct |
56 |
Correct |
1059 ms |
73572 KB |
Output is correct |
57 |
Correct |
1444 ms |
78568 KB |
Output is correct |
58 |
Correct |
1619 ms |
88748 KB |
Output is correct |
59 |
Correct |
1539 ms |
82284 KB |
Output is correct |
60 |
Correct |
740 ms |
65424 KB |
Output is correct |
61 |
Execution timed out |
6102 ms |
101528 KB |
Time limit exceeded |
62 |
Halted |
0 ms |
0 KB |
- |