답안 #68078

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68078 2018-08-15T21:23:14 Z wleung_bvg 철인 이종 경기 (APIO18_duathlon) C++14
100 / 100
292 ms 117416 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define f first
#define s second
#define all(a) (a).begin(),(a).end()
#define For(i,a,b) for(auto i=(a);i<(b);i++)
#define FOR(i,b) For(i,0,b)
#define Rev(i,a,b) for(auto i=(a);i>(b);i--)
#define REV(i,a) Rev(i,a,-1)
#define sz(a) ((int)(a).size())
using ll=long long;using ld=long double;using uint=unsigned int;using ull=unsigned long long;
using pii=pair<int,int>;using pll=pair<ll,ll>;using pill=pair<int,ll>;using plli=pair<ll,int>;using pdd=pair<double,double>;using pld=pair<ld,ld>;
constexpr const char nl='\n',sp=' ';constexpr const int INT_INF=0x3f3f3f3f;constexpr const ll LL_INF=0x3f3f3f3f3f3f3f3f;
constexpr const double D_INF=numeric_limits<double>::infinity();constexpr const ld LD_INF=numeric_limits<ld>::infinity();constexpr const double EPS=1e-9;
template<typename T1,typename T2>bool feq(const T1&x,const T2&y){return is_floating_point<common_type_t<T1,T2>>::value?abs(x-y)<=EPS:x==y;}
template<typename T1,typename T2>bool flt(const T1&x,const T2&y){return is_floating_point<common_type_t<T1,T2>>::value?x<y-EPS:x<y;}
template<typename T1,typename T2>bool fgt(const T1&x,const T2&y){return is_floating_point<common_type_t<T1,T2>>::value?x>y+EPS:x>y;}
template<typename T>constexpr const T&_min(const T&x,const T&y){return x<y?x:y;}template<typename T>constexpr const T&_max(const T&x,const T&y){return x<y?y:x;}
template<typename T,typename...Ts>constexpr const T&_min(const T&x,const Ts&...xs){return _min(x,_min(xs...));}
template<typename T,typename...Ts>constexpr const T&_max(const T&x,const Ts&...xs){return _max(x,_max(xs...));}
template<typename T,typename...Ts>void MIN(T&x,const Ts&...xs){x=_min(x,xs...);}template<typename T,typename...Ts>void MAX(T&x,const Ts&...xs){x=_max(x,xs...);}
template<typename T>constexpr const T&_clamp(const T&v,const T&lo,const T&hi){return v<lo?lo:hi<v?hi:v;}template<typename T>void CLAMP(T&v,const T&lo,const T&hi){v=_clamp(v,lo,hi);}
template<typename T,typename...Args>unique_ptr<T>_make_unique(Args&&...args){return unique_ptr<T>(new T(forward<Args>(args)...));}
template<typename T,typename...Args>shared_ptr<T>_make_shared(Args&&...args){return shared_ptr<T>(new T(forward<Args>(args)...));}
#define min _min
#define max _max
#define clamp _clamp
#define make_unique _make_unique
#define make_shared _make_shared
template<typename...Ts>using uset=unordered_set<Ts...>;template<typename...Ts>using umap=unordered_map<Ts...>;template<typename...Ts>using pq=priority_queue<Ts...>;
template<typename T>using minpq=pq<T,vector<T>,greater<T>>;template<typename T>using maxpq=pq<T,vector<T>,less<T>>;
template<typename T1,typename T2,typename H1=hash<T1>,typename H2=hash<T2>>struct pair_hash{size_t operator()(const pair<T1,T2>&p)const{return 31*H1{}(p.first)+H2{}(p.second);}};
seed_seq seq {
    (uint64_t)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count(),
    (uint64_t)__builtin_ia32_rdtsc(),(uint64_t)(uintptr_t)make_unique<char>().get()
};
mt19937 rng(seq);

constexpr int _bufferSize=4096,_maxNumLength=128;
char _inputBuffer[_bufferSize+1],*_inputPtr=_inputBuffer,_outputBuffer[_bufferSize],_c,_sign,*_tempInputBuf=nullptr,_numBuf[_maxNumLength],_tempOutputBuf[_maxNumLength],_fill=' ';
FILE*_input=stdin,*_output=stdout,*_error=stderr;const char*_delimiter=" ";int _cur,_outputPtr=0,_numPtr=0,_precision=6,_width=0,_tempOutputPtr=0,_cnt;ull _precisionBase=1000000;
#define _peekchar() (*_inputPtr?*_inputPtr:(_inputBuffer[fread(_inputPtr=_inputBuffer,1,_bufferSize,_input)]='\0',*_inputPtr))
#define _getchar() (*_inputPtr?*_inputPtr++:(_inputBuffer[fread(_inputPtr=_inputBuffer,1,_bufferSize,_input)]='\0',*_inputPtr++))
#define _hasNext() (*_inputPtr||!feof(_input))
#define _readSignAndNum(x) do{(x)=_getchar();}while((x)<=' ');_sign=(x)=='-';if(_sign)(x)=_getchar();for((x)-='0';(_c=_getchar())>='0';(x)=(x)*10+_c-'0')
#define _readFloatingPoint(x,T) for(T _div=1.0;(_c=_getchar())>='0';(x)+=(_c-'0')/(_div*=10))
#define rc(x) do{do{(x)=_getchar();}while((x)<=' ');}while(0)
#define ri(x) do{_readSignAndNum(x);if(_sign)(x)=-(x);}while(0)
#define rd(x) do{_readSignAndNum(x);if(_c=='.')_readFloatingPoint(x,double);if(_sign)(x)=-(x);}while(0)
#define rld(x) do{_readSignAndNum(x);if(_c=='.')_readFloatingPoint(x,ld);if(_sign)(x)=-(x);}while(0)
#define rcs(x) do{_cur=0;do{_c=_getchar();}while(_c<=' ');do{(x)[_cur++]=_c;}while((_c=_getchar())>' ');(x)[_cur]='\0';}while(0)
#define rs(x) do{if(!_tempInputBuf)assert(0);rcs(_tempInputBuf);(x)=string(_tempInputBuf,_cur);}while(0)
#define rcln(x) do{_cur=0;do{_c=_getchar();}while(_c<=' ');do{(x)[_cur++]=_c;}while((_c=_getchar())>=' ');(x)[_cur]='\0';}while(0)
#define rln(x) do{if(!_tempInputBuf)assert(0);rcln(_tempInputBuf);(x)=string(_tempInputBuf,_cur);}while(0)
#define setLength(x) do{if(_tempInputBuf)delete[](_tempInputBuf);_tempInputBuf=new char[(x)+1];}while(0)
void read(int&x){ri(x);}void read(uint&x){ri(x);}void read(ll&x){ri(x);}void read(ull&x){ri(x);}void read(double&x){rd(x);}void read(ld&x){rld(x);}
void read(char&x){rc(x);}void read(char*x){rcs(x);}void read(string&x){rs(x);}
template<typename T1,typename T2>void read(pair<T1,T2>&x){read(x.first);read(x.second);}template<typename T>void read(complex<T>&x){T _re,_im;read(_re);read(_im);x.real(_re);x.imag(_im);}
bool hasNext(){while(_hasNext()&&_peekchar()<=' ')_getchar();return _hasNext();}
template<typename T,typename...Ts>void read(T&x,Ts&...xs){read(x);read(xs...);}
void setInput(FILE*file){*_inputPtr='\0';_input=file;}void setInput(const char*s){*_inputPtr='\0';_input=fopen(s,"r");}void setInput(const string&s){*_inputPtr='\0';_input=fopen(s.c_str(),"r");}
#define _flush() do{_flushBuf();fflush(_output);}while(0)
#define _flushBuf() (fwrite(_outputBuffer,1,_outputPtr,_output),_outputPtr=0)
#define _putchar(x) (_outputBuffer[_outputPtr==_bufferSize?_flushBuf():_outputPtr]=(x),_outputPtr++)
#define _writeTempBuf(x) (_tempOutputBuf[_tempOutputPtr++]=(x))
#define _writeOutput() for(int _i=0;_i<_tempOutputPtr;_putchar(_tempOutputBuf[_i++]));_tempOutputPtr=0
#define _writeNum(x,T,digits) _cnt=0;for(T _y=(x);_y;_y/=10,_cnt++)_numBuf[_numPtr++]='0'+_y%10;for(;_cnt<digits;_cnt++)_numBuf[_numPtr++]='0';_flushNumBuf();
#define _writeFloatingPoint(x,T) ull _I=(ull)(x);ull _F=((x)-_I)*_precisionBase+(T)(0.5);if(_F>=_precisionBase){_I++;_F=0;}_writeNum(_I,ull,1);_writeTempBuf('.');_writeNum(_F,ull,_precision)
#define _checkFinite(x) if(std::isnan(x)){wcs("NaN");}else if(std::isinf(x)){wcs("Inf");}
#define _flushNumBuf() for(;_numPtr;_writeTempBuf(_numBuf[--_numPtr]))
#define _fillBuf(x) for(int _i=0;_i<(x);_i++)_putchar(_fill)
#define _flushTempBuf() int _tempLen=_tempOutputPtr;_fillBuf(_width-_tempLen);_writeOutput();_fillBuf(-_width-_tempLen)
#define wb(x) do{if(x)_writeTempBuf('1');else _writeTempBuf('0');_flushTempBuf();}while(0)
#define wc(x) do{_writeTempBuf(x); _flushTempBuf();}while(0)
#define wi(x) do{if((x)<0){_writeTempBuf('-');_writeNum(-(x),uint,1);}else{_writeNum(x,uint,1);}_flushTempBuf();}while(0)
#define wll(x) do{if((x)<0){_writeTempBuf('-');_writeNum(-(x),ull,1);}else{_writeNum(x,ull,1);}_flushTempBuf();}while(0)
#define wd(x) do{_checkFinite(x)else if((x)<0){_writeTempBuf('-');_writeFloatingPoint(-(x),double);}else{_writeFloatingPoint(x,double);}_flushTempBuf();}while(0)
#define wld(x) do{_checkFinite(x)else if((x)<0){_writeTempBuf('-');_writeFloatingPoint(-(x),ld);}else{_writeFloatingPoint(x,ld);}_flushTempBuf();}while(0)
#define wcs(x) do{int _slen=strlen(x);_fillBuf(_width-_slen);for(const char*_p=(x);*_p;_putchar(*_p++));_fillBuf(-_width-_slen);}while(0)
#define ws(x) do{_fillBuf(_width-(int)(x).length());for(int _i=0;_i<(int)(x).length();_putchar(x[_i++]));_fillBuf(-_width-(int)(x).length());}while(0)
#define setPrecision(x) do{_precision=(x);_precisionBase=1;for(int _i=0;_i<(x);_i++,_precisionBase*=10);}while(0)
#define setDelimiter(x) do{_delimiter=(x);}while(0)
#define setWidth(x) do{_width=(x);}while(0)
#define setFill(x) do{_fill=(x);}while(0)
void writeDelimiter(){for(const char*_p=_delimiter;*_p;_putchar(*_p++));}
void write(const bool&x){wb(x);}void write(const int&x){wi(x);}void write(const uint&x){wi(x);}void write(const ll&x){wll(x);}void write(const ull&x){wll(x);}
void write(const double&x){wd(x);}void write(const ld&x){wld(x);}void write(const char&x){wc(x);}void write(const char*x){wcs(x);}void write(const string&x){ws(x);}
template<typename T1,typename T2>void write(const pair<T1,T2>&x){write(x.first);writeDelimiter();write(x.second);}
template<typename T>void write(const complex<T>&x){write(x.real());writeDelimiter();write(x.imag());}
template<typename T>void write(const T&x){bool _first=1;for(auto&&_i:x){if(_first)_first=0;else writeDelimiter();write(_i);}}
template<typename T,typename...Ts>void write(const T&x,const Ts&...xs){write(x);writeDelimiter();write(xs...);}
void writeln(){_putchar('\n');}template<typename...Ts>void writeln(const Ts&...xs){write(xs...);_putchar('\n');}
void flush(){_flush();}class IOManager{public:~IOManager(){flush();}};unique_ptr<IOManager>iomanager=make_unique<IOManager>();
void setOutput(FILE*file){flush();_output=file;}void setOutput(const char*s){flush();_output=fopen(s,"w");}void setOutput(const string&s){flush();_output=fopen(s.c_str(),"w");}
template<typename...Ts>void debug(const Ts&...xs){FILE*_temp=_output;setOutput(_error);write(xs...);setOutput(_temp);}
template<typename...Ts>void debugln(const Ts&...xs){FILE*_temp=_output;setOutput(_error);writeln(xs...);setOutput(_temp);}
void setError(FILE*file){flush();_error=file;}void setError(const char*s){flush();_error=fopen(s,"w");}void setError(const string&s){flush();_error=fopen(s.c_str(),"w");}

#define MAXN 100005

int N, M, low[MAXN], pre[MAXN], cnt = 0, SZ[MAXN * 2];
ll ans = 0;
bool vis[MAXN];
vector<int> adj[MAXN], adj2[MAXN * 2];
vector<vector<int>> comp;
stack<pii> s;

void bcc(int v, int prev) {
    int children = 0;
    pre[v] = low[v] = cnt++;
    for (int w : adj[v]) {
        if (pre[w] == -1) {
            children++;
            s.emplace(v, w);
            bcc(w, v);
            MIN(low[v], low[w]);
            if ((prev == v && children > 1) || (prev != v && low[w] >= pre[v])) {
                comp.eb();
                while (s.top().f != v || s.top().s != w) {
                    comp.back().pb(s.top().f);
                    comp.back().pb(s.top().s);
                    s.pop();
                }
                comp.back().pb(s.top().f);
                comp.back().pb(s.top().s);
                s.pop();
            }
        } else if (w != prev && pre[w] < low[v]) {
            low[v] = pre[w];
            s.emplace(v, w);
        }
    }
}

void dfs1(int v, int prev) {
    if (v < N) vis[v] = true;
    SZ[v] = v < N;
    for (int w : adj2[v]) {
        if (w == prev) continue;
        dfs1(w, v);
        SZ[v] += SZ[w];
    }
}

void dfs2(int v, int r, int prev) {
    if (v < N) for (int w : adj2[v]) ans -= (w == prev ? SZ[v] * ll(SZ[v] - 1) : (SZ[r] - SZ[w]) * ll(SZ[r] - SZ[w] - 1)) * ll(sz(comp[w - N]) - 1);
    for (int w : adj2[v]) if (w != prev) dfs2(w, r, v);
}

int main() {
    // setInput("in.txt");
    // setOutput("out.txt");
    // setError("err.txt");
    read(N, M);
    int a, b;
    FOR(i, M) {
        read(a, b);
        adj[--a].pb(--b);
        adj[b].pb(a);
    }
    FOR(i, N) low[i] = pre[i] = -1;
    FOR(i, N) {
        if (pre[i] == -1) bcc(i, i);
        if (!s.empty()) {
            comp.eb();
            while (!s.empty()) {
                comp.back().pb(s.top().f);
                comp.back().pb(s.top().s);
                s.pop();
            }
        }
    }
    FOR(i, sz(comp)) {
        sort(all(comp[i]));
        comp[i].erase(unique(all(comp[i])), comp[i].end()); 
        for (int v : comp[i]) {
            adj2[v].pb(N + i);
            adj2[N + i].pb(v);
        }
    }
    FOR(i, N) vis[i] = false;
    FOR(i, N) {
        if (vis[i]) continue;
        dfs1(i, -1);
        ans += SZ[i] * ll(SZ[i] - 1) * ll(SZ[i] - 2);
        dfs2(i, i, -1);
    }
    writeln(ans);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 7416 KB Output is correct
2 Correct 11 ms 7528 KB Output is correct
3 Correct 11 ms 7528 KB Output is correct
4 Correct 8 ms 7532 KB Output is correct
5 Correct 10 ms 7568 KB Output is correct
6 Correct 9 ms 7568 KB Output is correct
7 Correct 8 ms 7636 KB Output is correct
8 Correct 8 ms 7636 KB Output is correct
9 Correct 8 ms 7720 KB Output is correct
10 Correct 8 ms 7740 KB Output is correct
11 Correct 8 ms 7740 KB Output is correct
12 Correct 8 ms 7740 KB Output is correct
13 Correct 8 ms 7784 KB Output is correct
14 Correct 9 ms 7784 KB Output is correct
15 Correct 8 ms 7784 KB Output is correct
16 Correct 8 ms 7784 KB Output is correct
17 Correct 7 ms 7784 KB Output is correct
18 Correct 10 ms 7784 KB Output is correct
19 Correct 7 ms 7784 KB Output is correct
20 Correct 10 ms 7784 KB Output is correct
21 Correct 8 ms 7784 KB Output is correct
22 Correct 7 ms 7836 KB Output is correct
23 Correct 10 ms 7836 KB Output is correct
24 Correct 9 ms 7880 KB Output is correct
25 Correct 9 ms 7880 KB Output is correct
26 Correct 8 ms 7880 KB Output is correct
27 Correct 8 ms 7880 KB Output is correct
28 Correct 8 ms 7880 KB Output is correct
29 Correct 8 ms 7880 KB Output is correct
30 Correct 8 ms 7880 KB Output is correct
31 Correct 8 ms 7880 KB Output is correct
32 Correct 8 ms 7880 KB Output is correct
33 Correct 8 ms 7880 KB Output is correct
34 Correct 8 ms 7880 KB Output is correct
35 Correct 8 ms 7880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 7416 KB Output is correct
2 Correct 11 ms 7528 KB Output is correct
3 Correct 11 ms 7528 KB Output is correct
4 Correct 8 ms 7532 KB Output is correct
5 Correct 10 ms 7568 KB Output is correct
6 Correct 9 ms 7568 KB Output is correct
7 Correct 8 ms 7636 KB Output is correct
8 Correct 8 ms 7636 KB Output is correct
9 Correct 8 ms 7720 KB Output is correct
10 Correct 8 ms 7740 KB Output is correct
11 Correct 8 ms 7740 KB Output is correct
12 Correct 8 ms 7740 KB Output is correct
13 Correct 8 ms 7784 KB Output is correct
14 Correct 9 ms 7784 KB Output is correct
15 Correct 8 ms 7784 KB Output is correct
16 Correct 8 ms 7784 KB Output is correct
17 Correct 7 ms 7784 KB Output is correct
18 Correct 10 ms 7784 KB Output is correct
19 Correct 7 ms 7784 KB Output is correct
20 Correct 10 ms 7784 KB Output is correct
21 Correct 8 ms 7784 KB Output is correct
22 Correct 7 ms 7836 KB Output is correct
23 Correct 10 ms 7836 KB Output is correct
24 Correct 9 ms 7880 KB Output is correct
25 Correct 9 ms 7880 KB Output is correct
26 Correct 8 ms 7880 KB Output is correct
27 Correct 8 ms 7880 KB Output is correct
28 Correct 8 ms 7880 KB Output is correct
29 Correct 8 ms 7880 KB Output is correct
30 Correct 8 ms 7880 KB Output is correct
31 Correct 8 ms 7880 KB Output is correct
32 Correct 8 ms 7880 KB Output is correct
33 Correct 8 ms 7880 KB Output is correct
34 Correct 8 ms 7880 KB Output is correct
35 Correct 8 ms 7880 KB Output is correct
36 Correct 8 ms 7880 KB Output is correct
37 Correct 8 ms 7880 KB Output is correct
38 Correct 7 ms 7880 KB Output is correct
39 Correct 8 ms 7880 KB Output is correct
40 Correct 8 ms 7880 KB Output is correct
41 Correct 8 ms 7880 KB Output is correct
42 Correct 8 ms 7880 KB Output is correct
43 Correct 8 ms 7880 KB Output is correct
44 Correct 7 ms 7880 KB Output is correct
45 Correct 7 ms 7956 KB Output is correct
46 Correct 7 ms 7956 KB Output is correct
47 Correct 7 ms 7956 KB Output is correct
48 Correct 8 ms 7956 KB Output is correct
49 Correct 8 ms 7956 KB Output is correct
50 Correct 9 ms 7956 KB Output is correct
51 Correct 8 ms 7956 KB Output is correct
52 Correct 8 ms 7956 KB Output is correct
53 Correct 8 ms 7956 KB Output is correct
54 Correct 7 ms 7956 KB Output is correct
55 Correct 7 ms 7956 KB Output is correct
56 Correct 8 ms 7956 KB Output is correct
57 Correct 7 ms 7956 KB Output is correct
58 Correct 11 ms 7956 KB Output is correct
59 Correct 8 ms 7956 KB Output is correct
60 Correct 10 ms 8056 KB Output is correct
61 Correct 10 ms 8056 KB Output is correct
62 Correct 9 ms 8056 KB Output is correct
63 Correct 9 ms 8056 KB Output is correct
64 Correct 10 ms 8056 KB Output is correct
65 Correct 8 ms 8056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 24476 KB Output is correct
2 Correct 134 ms 25748 KB Output is correct
3 Correct 105 ms 28276 KB Output is correct
4 Correct 140 ms 28284 KB Output is correct
5 Correct 182 ms 28284 KB Output is correct
6 Correct 185 ms 31424 KB Output is correct
7 Correct 194 ms 31424 KB Output is correct
8 Correct 172 ms 33136 KB Output is correct
9 Correct 123 ms 33136 KB Output is correct
10 Correct 130 ms 33532 KB Output is correct
11 Correct 125 ms 33532 KB Output is correct
12 Correct 102 ms 33532 KB Output is correct
13 Correct 99 ms 33992 KB Output is correct
14 Correct 130 ms 34728 KB Output is correct
15 Correct 87 ms 34728 KB Output is correct
16 Correct 106 ms 34728 KB Output is correct
17 Correct 13 ms 34728 KB Output is correct
18 Correct 13 ms 34728 KB Output is correct
19 Correct 11 ms 34728 KB Output is correct
20 Correct 11 ms 34728 KB Output is correct
21 Correct 13 ms 34728 KB Output is correct
22 Correct 13 ms 34728 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 34728 KB Output is correct
2 Correct 11 ms 34728 KB Output is correct
3 Correct 11 ms 34728 KB Output is correct
4 Correct 11 ms 34728 KB Output is correct
5 Correct 11 ms 34728 KB Output is correct
6 Correct 14 ms 34728 KB Output is correct
7 Correct 11 ms 34728 KB Output is correct
8 Correct 9 ms 34728 KB Output is correct
9 Correct 9 ms 34728 KB Output is correct
10 Correct 12 ms 34728 KB Output is correct
11 Correct 9 ms 34728 KB Output is correct
12 Correct 8 ms 34728 KB Output is correct
13 Correct 9 ms 34728 KB Output is correct
14 Correct 8 ms 34728 KB Output is correct
15 Correct 9 ms 34728 KB Output is correct
16 Correct 8 ms 34728 KB Output is correct
17 Correct 9 ms 34728 KB Output is correct
18 Correct 9 ms 34728 KB Output is correct
19 Correct 11 ms 34728 KB Output is correct
20 Correct 11 ms 34728 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 170 ms 41516 KB Output is correct
2 Correct 176 ms 42748 KB Output is correct
3 Correct 217 ms 44044 KB Output is correct
4 Correct 222 ms 45344 KB Output is correct
5 Correct 221 ms 46668 KB Output is correct
6 Correct 173 ms 54448 KB Output is correct
7 Correct 168 ms 54448 KB Output is correct
8 Correct 205 ms 54448 KB Output is correct
9 Correct 169 ms 54448 KB Output is correct
10 Correct 171 ms 54448 KB Output is correct
11 Correct 146 ms 54448 KB Output is correct
12 Correct 188 ms 55332 KB Output is correct
13 Correct 147 ms 56532 KB Output is correct
14 Correct 188 ms 56532 KB Output is correct
15 Correct 169 ms 56532 KB Output is correct
16 Correct 129 ms 56532 KB Output is correct
17 Correct 162 ms 61144 KB Output is correct
18 Correct 176 ms 62368 KB Output is correct
19 Correct 167 ms 63680 KB Output is correct
20 Correct 129 ms 64856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 64856 KB Output is correct
2 Correct 9 ms 64856 KB Output is correct
3 Correct 8 ms 64856 KB Output is correct
4 Correct 9 ms 64856 KB Output is correct
5 Correct 9 ms 64856 KB Output is correct
6 Correct 8 ms 64856 KB Output is correct
7 Correct 9 ms 64856 KB Output is correct
8 Correct 8 ms 64856 KB Output is correct
9 Correct 9 ms 64856 KB Output is correct
10 Correct 9 ms 64856 KB Output is correct
11 Correct 9 ms 64856 KB Output is correct
12 Correct 9 ms 64856 KB Output is correct
13 Correct 9 ms 64856 KB Output is correct
14 Correct 9 ms 64856 KB Output is correct
15 Correct 8 ms 64856 KB Output is correct
16 Correct 9 ms 64856 KB Output is correct
17 Correct 9 ms 64856 KB Output is correct
18 Correct 9 ms 64856 KB Output is correct
19 Correct 8 ms 64856 KB Output is correct
20 Correct 8 ms 64856 KB Output is correct
21 Correct 8 ms 64856 KB Output is correct
22 Correct 8 ms 64856 KB Output is correct
23 Correct 8 ms 64856 KB Output is correct
24 Correct 9 ms 64856 KB Output is correct
25 Correct 8 ms 64856 KB Output is correct
26 Correct 8 ms 64856 KB Output is correct
27 Correct 8 ms 64856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 171 ms 64856 KB Output is correct
2 Correct 185 ms 65664 KB Output is correct
3 Correct 158 ms 65876 KB Output is correct
4 Correct 236 ms 65876 KB Output is correct
5 Correct 131 ms 65876 KB Output is correct
6 Correct 157 ms 65876 KB Output is correct
7 Correct 154 ms 66820 KB Output is correct
8 Correct 88 ms 67624 KB Output is correct
9 Correct 110 ms 68868 KB Output is correct
10 Correct 138 ms 70188 KB Output is correct
11 Correct 129 ms 71148 KB Output is correct
12 Correct 85 ms 72044 KB Output is correct
13 Correct 115 ms 73408 KB Output is correct
14 Correct 126 ms 76160 KB Output is correct
15 Correct 251 ms 86804 KB Output is correct
16 Correct 226 ms 86804 KB Output is correct
17 Correct 198 ms 87940 KB Output is correct
18 Correct 292 ms 87940 KB Output is correct
19 Correct 196 ms 87940 KB Output is correct
20 Correct 200 ms 87940 KB Output is correct
21 Correct 188 ms 87940 KB Output is correct
22 Correct 184 ms 87940 KB Output is correct
23 Correct 142 ms 87940 KB Output is correct
24 Correct 198 ms 87940 KB Output is correct
25 Correct 200 ms 87940 KB Output is correct
26 Correct 196 ms 87940 KB Output is correct
27 Correct 162 ms 87940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 7416 KB Output is correct
2 Correct 11 ms 7528 KB Output is correct
3 Correct 11 ms 7528 KB Output is correct
4 Correct 8 ms 7532 KB Output is correct
5 Correct 10 ms 7568 KB Output is correct
6 Correct 9 ms 7568 KB Output is correct
7 Correct 8 ms 7636 KB Output is correct
8 Correct 8 ms 7636 KB Output is correct
9 Correct 8 ms 7720 KB Output is correct
10 Correct 8 ms 7740 KB Output is correct
11 Correct 8 ms 7740 KB Output is correct
12 Correct 8 ms 7740 KB Output is correct
13 Correct 8 ms 7784 KB Output is correct
14 Correct 9 ms 7784 KB Output is correct
15 Correct 8 ms 7784 KB Output is correct
16 Correct 8 ms 7784 KB Output is correct
17 Correct 7 ms 7784 KB Output is correct
18 Correct 10 ms 7784 KB Output is correct
19 Correct 7 ms 7784 KB Output is correct
20 Correct 10 ms 7784 KB Output is correct
21 Correct 8 ms 7784 KB Output is correct
22 Correct 7 ms 7836 KB Output is correct
23 Correct 10 ms 7836 KB Output is correct
24 Correct 9 ms 7880 KB Output is correct
25 Correct 9 ms 7880 KB Output is correct
26 Correct 8 ms 7880 KB Output is correct
27 Correct 8 ms 7880 KB Output is correct
28 Correct 8 ms 7880 KB Output is correct
29 Correct 8 ms 7880 KB Output is correct
30 Correct 8 ms 7880 KB Output is correct
31 Correct 8 ms 7880 KB Output is correct
32 Correct 8 ms 7880 KB Output is correct
33 Correct 8 ms 7880 KB Output is correct
34 Correct 8 ms 7880 KB Output is correct
35 Correct 8 ms 7880 KB Output is correct
36 Correct 8 ms 7880 KB Output is correct
37 Correct 8 ms 7880 KB Output is correct
38 Correct 7 ms 7880 KB Output is correct
39 Correct 8 ms 7880 KB Output is correct
40 Correct 8 ms 7880 KB Output is correct
41 Correct 8 ms 7880 KB Output is correct
42 Correct 8 ms 7880 KB Output is correct
43 Correct 8 ms 7880 KB Output is correct
44 Correct 7 ms 7880 KB Output is correct
45 Correct 7 ms 7956 KB Output is correct
46 Correct 7 ms 7956 KB Output is correct
47 Correct 7 ms 7956 KB Output is correct
48 Correct 8 ms 7956 KB Output is correct
49 Correct 8 ms 7956 KB Output is correct
50 Correct 9 ms 7956 KB Output is correct
51 Correct 8 ms 7956 KB Output is correct
52 Correct 8 ms 7956 KB Output is correct
53 Correct 8 ms 7956 KB Output is correct
54 Correct 7 ms 7956 KB Output is correct
55 Correct 7 ms 7956 KB Output is correct
56 Correct 8 ms 7956 KB Output is correct
57 Correct 7 ms 7956 KB Output is correct
58 Correct 11 ms 7956 KB Output is correct
59 Correct 8 ms 7956 KB Output is correct
60 Correct 10 ms 8056 KB Output is correct
61 Correct 10 ms 8056 KB Output is correct
62 Correct 9 ms 8056 KB Output is correct
63 Correct 9 ms 8056 KB Output is correct
64 Correct 10 ms 8056 KB Output is correct
65 Correct 8 ms 8056 KB Output is correct
66 Correct 9 ms 87940 KB Output is correct
67 Correct 8 ms 87940 KB Output is correct
68 Correct 10 ms 87940 KB Output is correct
69 Correct 9 ms 87940 KB Output is correct
70 Correct 10 ms 87940 KB Output is correct
71 Correct 11 ms 87940 KB Output is correct
72 Correct 8 ms 87940 KB Output is correct
73 Correct 10 ms 87940 KB Output is correct
74 Correct 8 ms 87940 KB Output is correct
75 Correct 8 ms 87940 KB Output is correct
76 Correct 8 ms 87940 KB Output is correct
77 Correct 9 ms 87940 KB Output is correct
78 Correct 9 ms 87940 KB Output is correct
79 Correct 9 ms 87940 KB Output is correct
80 Correct 9 ms 87940 KB Output is correct
81 Correct 9 ms 87940 KB Output is correct
82 Correct 11 ms 87940 KB Output is correct
83 Correct 10 ms 87940 KB Output is correct
84 Correct 11 ms 87940 KB Output is correct
85 Correct 9 ms 87940 KB Output is correct
86 Correct 11 ms 87940 KB Output is correct
87 Correct 11 ms 87940 KB Output is correct
88 Correct 11 ms 87940 KB Output is correct
89 Correct 11 ms 87940 KB Output is correct
90 Correct 9 ms 87940 KB Output is correct
91 Correct 11 ms 87940 KB Output is correct
92 Correct 10 ms 87940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 7416 KB Output is correct
2 Correct 11 ms 7528 KB Output is correct
3 Correct 11 ms 7528 KB Output is correct
4 Correct 8 ms 7532 KB Output is correct
5 Correct 10 ms 7568 KB Output is correct
6 Correct 9 ms 7568 KB Output is correct
7 Correct 8 ms 7636 KB Output is correct
8 Correct 8 ms 7636 KB Output is correct
9 Correct 8 ms 7720 KB Output is correct
10 Correct 8 ms 7740 KB Output is correct
11 Correct 8 ms 7740 KB Output is correct
12 Correct 8 ms 7740 KB Output is correct
13 Correct 8 ms 7784 KB Output is correct
14 Correct 9 ms 7784 KB Output is correct
15 Correct 8 ms 7784 KB Output is correct
16 Correct 8 ms 7784 KB Output is correct
17 Correct 7 ms 7784 KB Output is correct
18 Correct 10 ms 7784 KB Output is correct
19 Correct 7 ms 7784 KB Output is correct
20 Correct 10 ms 7784 KB Output is correct
21 Correct 8 ms 7784 KB Output is correct
22 Correct 7 ms 7836 KB Output is correct
23 Correct 10 ms 7836 KB Output is correct
24 Correct 9 ms 7880 KB Output is correct
25 Correct 9 ms 7880 KB Output is correct
26 Correct 8 ms 7880 KB Output is correct
27 Correct 8 ms 7880 KB Output is correct
28 Correct 8 ms 7880 KB Output is correct
29 Correct 8 ms 7880 KB Output is correct
30 Correct 8 ms 7880 KB Output is correct
31 Correct 8 ms 7880 KB Output is correct
32 Correct 8 ms 7880 KB Output is correct
33 Correct 8 ms 7880 KB Output is correct
34 Correct 8 ms 7880 KB Output is correct
35 Correct 8 ms 7880 KB Output is correct
36 Correct 8 ms 7880 KB Output is correct
37 Correct 8 ms 7880 KB Output is correct
38 Correct 7 ms 7880 KB Output is correct
39 Correct 8 ms 7880 KB Output is correct
40 Correct 8 ms 7880 KB Output is correct
41 Correct 8 ms 7880 KB Output is correct
42 Correct 8 ms 7880 KB Output is correct
43 Correct 8 ms 7880 KB Output is correct
44 Correct 7 ms 7880 KB Output is correct
45 Correct 7 ms 7956 KB Output is correct
46 Correct 7 ms 7956 KB Output is correct
47 Correct 7 ms 7956 KB Output is correct
48 Correct 8 ms 7956 KB Output is correct
49 Correct 8 ms 7956 KB Output is correct
50 Correct 9 ms 7956 KB Output is correct
51 Correct 8 ms 7956 KB Output is correct
52 Correct 8 ms 7956 KB Output is correct
53 Correct 8 ms 7956 KB Output is correct
54 Correct 7 ms 7956 KB Output is correct
55 Correct 7 ms 7956 KB Output is correct
56 Correct 8 ms 7956 KB Output is correct
57 Correct 7 ms 7956 KB Output is correct
58 Correct 11 ms 7956 KB Output is correct
59 Correct 8 ms 7956 KB Output is correct
60 Correct 10 ms 8056 KB Output is correct
61 Correct 10 ms 8056 KB Output is correct
62 Correct 9 ms 8056 KB Output is correct
63 Correct 9 ms 8056 KB Output is correct
64 Correct 10 ms 8056 KB Output is correct
65 Correct 8 ms 8056 KB Output is correct
66 Correct 84 ms 24476 KB Output is correct
67 Correct 134 ms 25748 KB Output is correct
68 Correct 105 ms 28276 KB Output is correct
69 Correct 140 ms 28284 KB Output is correct
70 Correct 182 ms 28284 KB Output is correct
71 Correct 185 ms 31424 KB Output is correct
72 Correct 194 ms 31424 KB Output is correct
73 Correct 172 ms 33136 KB Output is correct
74 Correct 123 ms 33136 KB Output is correct
75 Correct 130 ms 33532 KB Output is correct
76 Correct 125 ms 33532 KB Output is correct
77 Correct 102 ms 33532 KB Output is correct
78 Correct 99 ms 33992 KB Output is correct
79 Correct 130 ms 34728 KB Output is correct
80 Correct 87 ms 34728 KB Output is correct
81 Correct 106 ms 34728 KB Output is correct
82 Correct 13 ms 34728 KB Output is correct
83 Correct 13 ms 34728 KB Output is correct
84 Correct 11 ms 34728 KB Output is correct
85 Correct 11 ms 34728 KB Output is correct
86 Correct 13 ms 34728 KB Output is correct
87 Correct 13 ms 34728 KB Output is correct
88 Correct 10 ms 34728 KB Output is correct
89 Correct 11 ms 34728 KB Output is correct
90 Correct 11 ms 34728 KB Output is correct
91 Correct 11 ms 34728 KB Output is correct
92 Correct 11 ms 34728 KB Output is correct
93 Correct 14 ms 34728 KB Output is correct
94 Correct 11 ms 34728 KB Output is correct
95 Correct 9 ms 34728 KB Output is correct
96 Correct 9 ms 34728 KB Output is correct
97 Correct 12 ms 34728 KB Output is correct
98 Correct 9 ms 34728 KB Output is correct
99 Correct 8 ms 34728 KB Output is correct
100 Correct 9 ms 34728 KB Output is correct
101 Correct 8 ms 34728 KB Output is correct
102 Correct 9 ms 34728 KB Output is correct
103 Correct 8 ms 34728 KB Output is correct
104 Correct 9 ms 34728 KB Output is correct
105 Correct 9 ms 34728 KB Output is correct
106 Correct 11 ms 34728 KB Output is correct
107 Correct 11 ms 34728 KB Output is correct
108 Correct 170 ms 41516 KB Output is correct
109 Correct 176 ms 42748 KB Output is correct
110 Correct 217 ms 44044 KB Output is correct
111 Correct 222 ms 45344 KB Output is correct
112 Correct 221 ms 46668 KB Output is correct
113 Correct 173 ms 54448 KB Output is correct
114 Correct 168 ms 54448 KB Output is correct
115 Correct 205 ms 54448 KB Output is correct
116 Correct 169 ms 54448 KB Output is correct
117 Correct 171 ms 54448 KB Output is correct
118 Correct 146 ms 54448 KB Output is correct
119 Correct 188 ms 55332 KB Output is correct
120 Correct 147 ms 56532 KB Output is correct
121 Correct 188 ms 56532 KB Output is correct
122 Correct 169 ms 56532 KB Output is correct
123 Correct 129 ms 56532 KB Output is correct
124 Correct 162 ms 61144 KB Output is correct
125 Correct 176 ms 62368 KB Output is correct
126 Correct 167 ms 63680 KB Output is correct
127 Correct 129 ms 64856 KB Output is correct
128 Correct 9 ms 64856 KB Output is correct
129 Correct 9 ms 64856 KB Output is correct
130 Correct 8 ms 64856 KB Output is correct
131 Correct 9 ms 64856 KB Output is correct
132 Correct 9 ms 64856 KB Output is correct
133 Correct 8 ms 64856 KB Output is correct
134 Correct 9 ms 64856 KB Output is correct
135 Correct 8 ms 64856 KB Output is correct
136 Correct 9 ms 64856 KB Output is correct
137 Correct 9 ms 64856 KB Output is correct
138 Correct 9 ms 64856 KB Output is correct
139 Correct 9 ms 64856 KB Output is correct
140 Correct 9 ms 64856 KB Output is correct
141 Correct 9 ms 64856 KB Output is correct
142 Correct 8 ms 64856 KB Output is correct
143 Correct 9 ms 64856 KB Output is correct
144 Correct 9 ms 64856 KB Output is correct
145 Correct 9 ms 64856 KB Output is correct
146 Correct 8 ms 64856 KB Output is correct
147 Correct 8 ms 64856 KB Output is correct
148 Correct 8 ms 64856 KB Output is correct
149 Correct 8 ms 64856 KB Output is correct
150 Correct 8 ms 64856 KB Output is correct
151 Correct 9 ms 64856 KB Output is correct
152 Correct 8 ms 64856 KB Output is correct
153 Correct 8 ms 64856 KB Output is correct
154 Correct 8 ms 64856 KB Output is correct
155 Correct 171 ms 64856 KB Output is correct
156 Correct 185 ms 65664 KB Output is correct
157 Correct 158 ms 65876 KB Output is correct
158 Correct 236 ms 65876 KB Output is correct
159 Correct 131 ms 65876 KB Output is correct
160 Correct 157 ms 65876 KB Output is correct
161 Correct 154 ms 66820 KB Output is correct
162 Correct 88 ms 67624 KB Output is correct
163 Correct 110 ms 68868 KB Output is correct
164 Correct 138 ms 70188 KB Output is correct
165 Correct 129 ms 71148 KB Output is correct
166 Correct 85 ms 72044 KB Output is correct
167 Correct 115 ms 73408 KB Output is correct
168 Correct 126 ms 76160 KB Output is correct
169 Correct 251 ms 86804 KB Output is correct
170 Correct 226 ms 86804 KB Output is correct
171 Correct 198 ms 87940 KB Output is correct
172 Correct 292 ms 87940 KB Output is correct
173 Correct 196 ms 87940 KB Output is correct
174 Correct 200 ms 87940 KB Output is correct
175 Correct 188 ms 87940 KB Output is correct
176 Correct 184 ms 87940 KB Output is correct
177 Correct 142 ms 87940 KB Output is correct
178 Correct 198 ms 87940 KB Output is correct
179 Correct 200 ms 87940 KB Output is correct
180 Correct 196 ms 87940 KB Output is correct
181 Correct 162 ms 87940 KB Output is correct
182 Correct 9 ms 87940 KB Output is correct
183 Correct 8 ms 87940 KB Output is correct
184 Correct 10 ms 87940 KB Output is correct
185 Correct 9 ms 87940 KB Output is correct
186 Correct 10 ms 87940 KB Output is correct
187 Correct 11 ms 87940 KB Output is correct
188 Correct 8 ms 87940 KB Output is correct
189 Correct 10 ms 87940 KB Output is correct
190 Correct 8 ms 87940 KB Output is correct
191 Correct 8 ms 87940 KB Output is correct
192 Correct 8 ms 87940 KB Output is correct
193 Correct 9 ms 87940 KB Output is correct
194 Correct 9 ms 87940 KB Output is correct
195 Correct 9 ms 87940 KB Output is correct
196 Correct 9 ms 87940 KB Output is correct
197 Correct 9 ms 87940 KB Output is correct
198 Correct 11 ms 87940 KB Output is correct
199 Correct 10 ms 87940 KB Output is correct
200 Correct 11 ms 87940 KB Output is correct
201 Correct 9 ms 87940 KB Output is correct
202 Correct 11 ms 87940 KB Output is correct
203 Correct 11 ms 87940 KB Output is correct
204 Correct 11 ms 87940 KB Output is correct
205 Correct 11 ms 87940 KB Output is correct
206 Correct 9 ms 87940 KB Output is correct
207 Correct 11 ms 87940 KB Output is correct
208 Correct 10 ms 87940 KB Output is correct
209 Correct 12 ms 87940 KB Output is correct
210 Correct 106 ms 87940 KB Output is correct
211 Correct 122 ms 87940 KB Output is correct
212 Correct 124 ms 88676 KB Output is correct
213 Correct 149 ms 92108 KB Output is correct
214 Correct 66 ms 92108 KB Output is correct
215 Correct 96 ms 92108 KB Output is correct
216 Correct 210 ms 96520 KB Output is correct
217 Correct 149 ms 96520 KB Output is correct
218 Correct 114 ms 96520 KB Output is correct
219 Correct 100 ms 96520 KB Output is correct
220 Correct 120 ms 97288 KB Output is correct
221 Correct 94 ms 98332 KB Output is correct
222 Correct 114 ms 100248 KB Output is correct
223 Correct 129 ms 106032 KB Output is correct
224 Correct 126 ms 107120 KB Output is correct
225 Correct 124 ms 107152 KB Output is correct
226 Correct 124 ms 108864 KB Output is correct
227 Correct 122 ms 110560 KB Output is correct
228 Correct 100 ms 111452 KB Output is correct
229 Correct 93 ms 112348 KB Output is correct
230 Correct 100 ms 115552 KB Output is correct
231 Correct 112 ms 117416 KB Output is correct