답안 #403012

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
403012 2021-05-12T16:20:37 Z PedroBigMan 꿈 (IOI13_dreaming) C++17
59 / 100
217 ms 65540 KB
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#include "dreaming.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <list>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
using namespace std;
typedef int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define whole(x) x.begin(),x.end()
#define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl
#define INF 500000000

template<class A=ll> 
void Out(vector<A> a) {REP(i,0,a.size()) {cout<<a[i]<<" ";} cout<<endl;}

template<class A=ll>
void In(vector<A> &a, ll N) {A cur; REP(i,0,N) {cin>>cur; a.pb(cur);}}

class WTree
{
    public:
    ll N; 
    vector<ll> p; 
    vector<vector<pl> > sons;
    vector<vector<pl> > adj;
    ll root;
    vector<bool> visited;
    vector<vector<ll> > farthest_dir;
    vector<ll> farthest_down;
    vector<ll> farthest_up;
    vector<ll> farthest;
	vector<ll> dist;
	pair<ll,pl> diametre;
    
    WTree(vector<vector<pl> > ad, ll r=0LL)
    {
        N=ad.size(); root=r; adj=ad;
        vector<pl> xx; REP(i,0,N) {sons.pb(xx); p.pb(-1);}
		REP(i,0,N) {visited.pb(false);}
        DFS_Build(r,r); 
		vector<ll> xxx;
        REP(i,0,N) {farthest_up.pb(0); farthest_down.pb(0); farthest_dir.pb(xxx); farthest.pb(0);}
        REP(i,0,N) {REP(j,0,adj[i].size()) {farthest_dir[i].pb(0);}}
    }
	
	void Reset()
    {
        REP(i,0,N) {visited[i]=false;}
    }
    
    void DFS_Build(ll s, ll par)
    {
        p[s]=par;
		visited[s]=true;
        REP(i,0,adj[s].size())
        {
            if(adj[s][i].ff==par) {continue;}
            sons[s].pb(adj[s][i]);
            DFS_Build(adj[s][i].ff,s);
        }
        return;
    }
	
	void DFS_distance(ll s, ll las)
    {
        REP(i,0,adj[s].size()) 
        {
            if(adj[s][i].ff==las) {continue;}
            dist[adj[s][i].ff]=dist[s]+adj[s][i].ss;
            DFS_distance(adj[s][i].ff,s);
        }
    }
    
    void distance(ll s)
    {
        dist.clear(); REP(i,0,N) {dist.pb(INF);}
        dist[s]=0LL;
        DFS_distance(s,s);
    }
    
    void Calc_Diametre()
    {
        distance(root); 
        vector<ll>::iterator it=max_element(whole(dist));
        ll ind=it-dist.begin();
        distance(ind);
        diametre.ss.ff=ind;
        it=max_element(whole(dist));
        diametre.ss.ss=it-dist.begin();
        diametre.ff=*it;
    }
    
    void Calc_farthest_down(ll s)
    {
        REP(i,0,sons[s].size()) {Calc_farthest_down(sons[s][i].ff);}
        REP(i,0,adj[s].size()) 
        {
            if(adj[s][i].ff==p[s]) {continue;}
            farthest_dir[s][i]=farthest_down[adj[s][i].ff]+adj[s][i].ss;
            farthest_down[s]=max(farthest_down[s],farthest_dir[s][i]);
        }
    }
    
    void Calc_farthest_up(ll s)
    {
        if(s==root) {farthest_up[s]=0LL;}
        pl best_dis=mp(0,0);
        REP(i,0,adj[s].size()) 
        {
            if(farthest_dir[s][i]>best_dis.ff) {best_dis.ss=best_dis.ff; best_dis.ff=farthest_dir[s][i];}
            else if(farthest_dir[s][i]>best_dis.ss) {best_dis.ss=farthest_dir[s][i];}
        }
        REP(i,0,adj[s].size())
        {
            if(adj[s][i].ff==p[s]) {continue;}
            ll c = adj[s][i].ff;
            if(best_dis.ff == farthest_dir[s][i]) {farthest_up[c] = best_dis.ss+adj[s][i].ss;}
            else {farthest_up[c]=best_dis.ff+adj[s][i].ss;}
            REP(j,0,adj[c].size()) {if(adj[c][j].ff==s) {farthest_dir[c][j]=farthest_up[c];}}
        }
        REP(i,0,sons[s].size()) {Calc_farthest_up(sons[s][i].ff);}
    }
    
    void Calc_farthest()
    {
        Calc_farthest_down(root);
        Calc_farthest_up(root);
        REP(i,0,N) {farthest[i]=max(farthest_up[i],farthest_down[i]);}
    }
	
	pl Radius() //returns {centre, radius}
	{
		Calc_farthest();
		ll ind=0LL; ll val = farthest[0];
		REP(i,1,N) 
		{
			if(farthest[i]<val) {val=farthest[i]; ind=i;}
		}
		return (pl) {ind,val};
	}
   	
	
};

class WG //everything works for weighted directed graphs except dynamic graph
{
    public:
    ll N; vector<vector<pl> > adj;
 	vector<bool> visited;
	vector<ll> current;
    
    WG(vector<vector<pl> > ad)
    {
        adj=ad; N=adj.size();
        REP(i,0,N) {visited.pb(false);}
    }
    
    void Reset()
    {
        REP(i,0,N) {visited[i]=false;}
    }
	
	void DFS(ll s) 
    {
        if(visited[s]) {return;}
        visited[s]=true;
        current.pb(s); //only needed for CC
        REP(i,0,adj[s].size())
        {
            if(!visited[adj[s][i].ff]) {DFS(adj[s][i].ff);}
        }
        return;
    }
	
	vector<vector<ll> > CC()
    {
        Reset();
        ll fi=0; ll missing=N; REP(i,0,N) {visited[i]=false;}
        vector<vector<ll> > ans;
        while(missing>0)
        {
            REP(i,fi,N) {if(!visited[i]) {fi=i; break;}}
            current.clear();
            DFS(fi);
            ans.pb(current);
            missing-=current.size();
        }
        return ans;
    }
	
	vector<WTree> CCG()
    {
        Reset();
        vector<WTree> ans;
        vector<vector<ll> > CC=(*this).CC();
		vector<ll> m; REP(i,0,N) {m.pb(-1);} vector<pl> xx; vector<vector<pl> > ad;
        REP(cc,0,CC.size()) 
        {
            m.clear(); 
            ad.clear(); 
            ll NN=CC[cc].size();
            REP(i,0,NN) {ad.pb(xx);}
            REP(i,0,NN) {m[CC[cc][i]]=i;}
            ll a,b;
            REP(i,0,NN)
            {
                a=CC[cc][i];
                REP(j,0,adj[a].size()) {b=adj[a][j].ff; ad[i].pb({m[b],adj[a][j].ss});}
            }
            WTree H(ad);
            ans.pb(H);
        }
        return ans;
    }
};

int travelTime(int n, int m, int L, int A[], int B[], int T[]) 
{
	int a;
    ll N = (ll) n; ll M = (ll) m; vector<pl> xx; vector<vector<pl> > adj; REP(i,0,N) {adj.pb(xx);}
	REP(i,0,M)
	{
		adj[A[i]].pb({B[i],T[i]}); adj[B[i]].pb({A[i],T[i]});
	}
	WG G(adj);
	vector<WTree> F = G.CCG();
	ll ans = 0LL;
	REP(i,0,F.size()) {F[i].Calc_Diametre(); ans=max(ans,F[i].diametre.ff);}
	vector<ll> R; REP(i,0,F.size()) {R.pb(F[i].Radius().ss);}
	sort(whole(R)); reverse(whole(R));
	if(R.size()>=2) {ans=max(ans,L+R[0]+R[1]);}
	if(R.size()>=3) {ans=max((ll) ans,(ll) 2LL*L+R[1]+R[2]);}
	return ans;
}

Compilation message

dreaming.cpp:1: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    1 | #pragma GCC optimization ("O3")
      | 
dreaming.cpp:2: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    2 | #pragma GCC optimization ("unroll-loops")
      | 
dreaming.cpp: In constructor 'WTree::WTree(std::vector<std::vector<std::pair<int, int> > >, ll)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
   64 |         REP(i,0,N) {REP(j,0,adj[i].size()) {farthest_dir[i].pb(0);}}
      |                         ~~~~~~~~~~~~~~~~~
dreaming.cpp:64:21: note: in expansion of macro 'REP'
   64 |         REP(i,0,N) {REP(j,0,adj[i].size()) {farthest_dir[i].pb(0);}}
      |                     ^~~
dreaming.cpp: In member function 'void WTree::DFS_Build(ll, ll)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
   76 |         REP(i,0,adj[s].size())
      |             ~~~~~~~~~~~~~~~~~    
dreaming.cpp:76:9: note: in expansion of macro 'REP'
   76 |         REP(i,0,adj[s].size())
      |         ^~~
dreaming.cpp: In member function 'void WTree::DFS_distance(ll, ll)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
   87 |         REP(i,0,adj[s].size())
      |             ~~~~~~~~~~~~~~~~~    
dreaming.cpp:87:9: note: in expansion of macro 'REP'
   87 |         REP(i,0,adj[s].size())
      |         ^~~
dreaming.cpp: In member function 'void WTree::Calc_farthest_down(ll)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  116 |         REP(i,0,sons[s].size()) {Calc_farthest_down(sons[s][i].ff);}
      |             ~~~~~~~~~~~~~~~~~~   
dreaming.cpp:116:9: note: in expansion of macro 'REP'
  116 |         REP(i,0,sons[s].size()) {Calc_farthest_down(sons[s][i].ff);}
      |         ^~~
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  117 |         REP(i,0,adj[s].size())
      |             ~~~~~~~~~~~~~~~~~    
dreaming.cpp:117:9: note: in expansion of macro 'REP'
  117 |         REP(i,0,adj[s].size())
      |         ^~~
dreaming.cpp: In member function 'void WTree::Calc_farthest_up(ll)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  129 |         REP(i,0,adj[s].size())
      |             ~~~~~~~~~~~~~~~~~    
dreaming.cpp:129:9: note: in expansion of macro 'REP'
  129 |         REP(i,0,adj[s].size())
      |         ^~~
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  134 |         REP(i,0,adj[s].size())
      |             ~~~~~~~~~~~~~~~~~    
dreaming.cpp:134:9: note: in expansion of macro 'REP'
  134 |         REP(i,0,adj[s].size())
      |         ^~~
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  140 |             REP(j,0,adj[c].size()) {if(adj[c][j].ff==s) {farthest_dir[c][j]=farthest_up[c];}}
      |                 ~~~~~~~~~~~~~~~~~
dreaming.cpp:140:13: note: in expansion of macro 'REP'
  140 |             REP(j,0,adj[c].size()) {if(adj[c][j].ff==s) {farthest_dir[c][j]=farthest_up[c];}}
      |             ^~~
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  142 |         REP(i,0,sons[s].size()) {Calc_farthest_up(sons[s][i].ff);}
      |             ~~~~~~~~~~~~~~~~~~   
dreaming.cpp:142:9: note: in expansion of macro 'REP'
  142 |         REP(i,0,sons[s].size()) {Calc_farthest_up(sons[s][i].ff);}
      |         ^~~
dreaming.cpp: In member function 'void WG::DFS(ll)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  189 |         REP(i,0,adj[s].size())
      |             ~~~~~~~~~~~~~~~~~    
dreaming.cpp:189:9: note: in expansion of macro 'REP'
  189 |         REP(i,0,adj[s].size())
      |         ^~~
dreaming.cpp: In member function 'std::vector<WTree> WG::CCG()':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  218 |         REP(cc,0,CC.size())
      |             ~~~~~~~~~~~~~~       
dreaming.cpp:218:9: note: in expansion of macro 'REP'
  218 |         REP(cc,0,CC.size())
      |         ^~~
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  229 |                 REP(j,0,adj[a].size()) {b=adj[a][j].ff; ad[i].pb({m[b],adj[a][j].ss});}
      |                     ~~~~~~~~~~~~~~~~~
dreaming.cpp:229:17: note: in expansion of macro 'REP'
  229 |                 REP(j,0,adj[a].size()) {b=adj[a][j].ff; ad[i].pb({m[b],adj[a][j].ss});}
      |                 ^~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<WTree>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  249 |  REP(i,0,F.size()) {F[i].Calc_Diametre(); ans=max(ans,F[i].diametre.ff);}
      |      ~~~~~~~~~~~~                
dreaming.cpp:249:2: note: in expansion of macro 'REP'
  249 |  REP(i,0,F.size()) {F[i].Calc_Diametre(); ans=max(ans,F[i].diametre.ff);}
      |  ^~~
dreaming.cpp:24:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<WTree>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | #define REP(i,a,b) for(ll i=a; i<b; i++)
......
  250 |  vector<ll> R; REP(i,0,F.size()) {R.pb(F[i].Radius().ss);}
      |                    ~~~~~~~~~~~~  
dreaming.cpp:250:16: note: in expansion of macro 'REP'
  250 |  vector<ll> R; REP(i,0,F.size()) {R.pb(F[i].Radius().ss);}
      |                ^~~
dreaming.cpp:240:6: warning: unused variable 'a' [-Wunused-variable]
  240 |  int a;
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 156 ms 53280 KB Output is correct
2 Correct 161 ms 52944 KB Output is correct
3 Correct 97 ms 35264 KB Output is correct
4 Correct 21 ms 8000 KB Output is correct
5 Correct 15 ms 4824 KB Output is correct
6 Correct 33 ms 11972 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 65 ms 19760 KB Output is correct
9 Correct 83 ms 25676 KB Output is correct
10 Correct 2 ms 588 KB Output is correct
11 Correct 120 ms 31616 KB Output is correct
12 Correct 147 ms 42548 KB Output is correct
13 Correct 2 ms 716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 1 ms 332 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 332 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 1 ms 332 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 156 ms 53280 KB Output is correct
2 Correct 161 ms 52944 KB Output is correct
3 Correct 97 ms 35264 KB Output is correct
4 Correct 21 ms 8000 KB Output is correct
5 Correct 15 ms 4824 KB Output is correct
6 Correct 33 ms 11972 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 65 ms 19760 KB Output is correct
9 Correct 83 ms 25676 KB Output is correct
10 Correct 2 ms 588 KB Output is correct
11 Correct 120 ms 31616 KB Output is correct
12 Correct 147 ms 42548 KB Output is correct
13 Correct 2 ms 716 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 332 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 1 ms 332 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 1 ms 332 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 1 ms 332 KB Output is correct
33 Correct 1 ms 332 KB Output is correct
34 Correct 1 ms 332 KB Output is correct
35 Correct 1 ms 332 KB Output is correct
36 Correct 1 ms 332 KB Output is correct
37 Correct 1 ms 332 KB Output is correct
38 Correct 1 ms 332 KB Output is correct
39 Correct 167 ms 53228 KB Output is correct
40 Correct 157 ms 52980 KB Output is correct
41 Correct 107 ms 35284 KB Output is correct
42 Correct 21 ms 7948 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 1 ms 332 KB Output is correct
45 Correct 1 ms 332 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 196 ms 52576 KB Output is correct
58 Correct 201 ms 42472 KB Output is correct
59 Correct 217 ms 49700 KB Output is correct
60 Correct 193 ms 43380 KB Output is correct
61 Correct 202 ms 50204 KB Output is correct
62 Correct 206 ms 46536 KB Output is correct
63 Correct 183 ms 55092 KB Output is correct
64 Correct 190 ms 55100 KB Output is correct
65 Correct 189 ms 55160 KB Output is correct
66 Correct 188 ms 55100 KB Output is correct
67 Correct 197 ms 50932 KB Output is correct
68 Correct 197 ms 50052 KB Output is correct
69 Correct 206 ms 44852 KB Output is correct
70 Correct 193 ms 42852 KB Output is correct
71 Correct 1 ms 204 KB Output is correct
72 Correct 5 ms 1608 KB Output is correct
73 Correct 6 ms 1740 KB Output is correct
74 Correct 6 ms 1884 KB Output is correct
75 Correct 5 ms 1484 KB Output is correct
76 Correct 6 ms 1740 KB Output is correct
77 Correct 5 ms 1740 KB Output is correct
78 Correct 6 ms 1612 KB Output is correct
79 Correct 6 ms 1688 KB Output is correct
80 Correct 191 ms 48292 KB Output is correct
81 Correct 197 ms 42904 KB Output is correct
82 Correct 194 ms 49864 KB Output is correct
83 Correct 199 ms 54020 KB Output is correct
84 Correct 4 ms 1356 KB Output is correct
85 Correct 4 ms 1228 KB Output is correct
86 Correct 4 ms 1356 KB Output is correct
87 Correct 7 ms 1424 KB Output is correct
88 Correct 5 ms 1484 KB Output is correct
89 Correct 5 ms 1356 KB Output is correct
90 Correct 5 ms 1356 KB Output is correct
91 Correct 6 ms 1740 KB Output is correct
92 Correct 5 ms 1484 KB Output is correct
93 Correct 5 ms 1356 KB Output is correct
94 Correct 1 ms 332 KB Output is correct
95 Correct 1 ms 332 KB Output is correct
96 Correct 1 ms 332 KB Output is correct
97 Correct 1 ms 332 KB Output is correct
98 Correct 1 ms 332 KB Output is correct
99 Correct 1 ms 332 KB Output is correct
100 Correct 1 ms 332 KB Output is correct
101 Correct 1 ms 332 KB Output is correct
102 Correct 1 ms 332 KB Output is correct
103 Correct 1 ms 332 KB Output is correct
104 Correct 16 ms 4840 KB Output is correct
105 Correct 34 ms 12004 KB Output is correct
106 Correct 1 ms 460 KB Output is correct
107 Correct 65 ms 19652 KB Output is correct
108 Correct 82 ms 25668 KB Output is correct
109 Correct 2 ms 588 KB Output is correct
110 Correct 120 ms 31612 KB Output is correct
111 Correct 140 ms 42468 KB Output is correct
112 Correct 2 ms 716 KB Output is correct
113 Correct 187 ms 59872 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 197 ms 52548 KB Output is correct
2 Correct 198 ms 52656 KB Output is correct
3 Correct 198 ms 52456 KB Output is correct
4 Correct 201 ms 52768 KB Output is correct
5 Correct 216 ms 52232 KB Output is correct
6 Runtime error 154 ms 65540 KB Execution killed with signal 9
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 1 ms 332 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 332 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 1 ms 332 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 3 ms 588 KB Output is correct
27 Correct 4 ms 1012 KB Output is correct
28 Correct 6 ms 1356 KB Output is correct
29 Correct 3 ms 588 KB Output is correct
30 Correct 4 ms 1100 KB Output is correct
31 Correct 6 ms 1356 KB Output is correct
32 Correct 2 ms 588 KB Output is correct
33 Correct 4 ms 1100 KB Output is correct
34 Correct 6 ms 1356 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 332 KB Output is correct
37 Correct 1 ms 332 KB Output is correct
38 Correct 1 ms 332 KB Output is correct
39 Correct 1 ms 332 KB Output is correct
40 Correct 1 ms 332 KB Output is correct
41 Correct 1 ms 332 KB Output is correct
42 Correct 1 ms 332 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 1 ms 332 KB Output is correct
45 Correct 1 ms 332 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 5 ms 1996 KB Output is correct
55 Correct 5 ms 1996 KB Output is correct
56 Correct 6 ms 1732 KB Output is correct
57 Correct 6 ms 2360 KB Output is correct
58 Correct 5 ms 1484 KB Output is correct
59 Correct 5 ms 1740 KB Output is correct
60 Correct 6 ms 1848 KB Output is correct
61 Correct 6 ms 2360 KB Output is correct
62 Correct 5 ms 1456 KB Output is correct
63 Correct 6 ms 1612 KB Output is correct
64 Correct 6 ms 2232 KB Output is correct
65 Correct 6 ms 1860 KB Output is correct
66 Correct 6 ms 1868 KB Output is correct
67 Correct 5 ms 1484 KB Output is correct
68 Correct 6 ms 1860 KB Output is correct
69 Correct 6 ms 1604 KB Output is correct
70 Correct 6 ms 1848 KB Output is correct
71 Correct 6 ms 1848 KB Output is correct
72 Correct 5 ms 1740 KB Output is correct
73 Correct 5 ms 1740 KB Output is correct
74 Correct 6 ms 1228 KB Output is correct
75 Correct 6 ms 1228 KB Output is correct
76 Correct 6 ms 1612 KB Output is correct
77 Correct 5 ms 1612 KB Output is correct
78 Correct 6 ms 1848 KB Output is correct
79 Correct 6 ms 1848 KB Output is correct
80 Correct 5 ms 2232 KB Output is correct
81 Correct 6 ms 2232 KB Output is correct
82 Correct 6 ms 1356 KB Output is correct
83 Correct 6 ms 1356 KB Output is correct
84 Correct 7 ms 1848 KB Output is correct
85 Correct 6 ms 2232 KB Output is correct
86 Correct 6 ms 1860 KB Output is correct
87 Correct 6 ms 1740 KB Output is correct
88 Correct 7 ms 1860 KB Output is correct
89 Correct 6 ms 1860 KB Output is correct
90 Correct 6 ms 1848 KB Output is correct
91 Correct 6 ms 1848 KB Output is correct
92 Correct 4 ms 1356 KB Output is correct
93 Correct 4 ms 1228 KB Output is correct
94 Correct 4 ms 1356 KB Output is correct
95 Correct 5 ms 1356 KB Output is correct
96 Correct 5 ms 1368 KB Output is correct
97 Correct 5 ms 1356 KB Output is correct
98 Correct 5 ms 1356 KB Output is correct
99 Correct 6 ms 1740 KB Output is correct
100 Correct 5 ms 1516 KB Output is correct
101 Correct 5 ms 1356 KB Output is correct
102 Correct 1 ms 332 KB Output is correct
103 Correct 1 ms 332 KB Output is correct
104 Correct 1 ms 332 KB Output is correct
105 Correct 1 ms 332 KB Output is correct
106 Correct 1 ms 332 KB Output is correct
107 Correct 1 ms 332 KB Output is correct
108 Correct 1 ms 332 KB Output is correct
109 Correct 1 ms 332 KB Output is correct
110 Correct 1 ms 332 KB Output is correct
111 Correct 1 ms 332 KB Output is correct
112 Correct 1 ms 460 KB Output is correct
113 Correct 2 ms 600 KB Output is correct
114 Correct 2 ms 716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 156 ms 53280 KB Output is correct
2 Correct 161 ms 52944 KB Output is correct
3 Correct 97 ms 35264 KB Output is correct
4 Correct 21 ms 8000 KB Output is correct
5 Correct 15 ms 4824 KB Output is correct
6 Correct 33 ms 11972 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 65 ms 19760 KB Output is correct
9 Correct 83 ms 25676 KB Output is correct
10 Correct 2 ms 588 KB Output is correct
11 Correct 120 ms 31616 KB Output is correct
12 Correct 147 ms 42548 KB Output is correct
13 Correct 2 ms 716 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 332 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 332 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 1 ms 332 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 1 ms 332 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 1 ms 332 KB Output is correct
33 Correct 1 ms 332 KB Output is correct
34 Correct 1 ms 332 KB Output is correct
35 Correct 1 ms 332 KB Output is correct
36 Correct 1 ms 332 KB Output is correct
37 Correct 1 ms 332 KB Output is correct
38 Correct 1 ms 332 KB Output is correct
39 Correct 167 ms 53228 KB Output is correct
40 Correct 157 ms 52980 KB Output is correct
41 Correct 107 ms 35284 KB Output is correct
42 Correct 21 ms 7948 KB Output is correct
43 Correct 1 ms 332 KB Output is correct
44 Correct 1 ms 332 KB Output is correct
45 Correct 1 ms 332 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 196 ms 52576 KB Output is correct
58 Correct 201 ms 42472 KB Output is correct
59 Correct 217 ms 49700 KB Output is correct
60 Correct 193 ms 43380 KB Output is correct
61 Correct 202 ms 50204 KB Output is correct
62 Correct 206 ms 46536 KB Output is correct
63 Correct 183 ms 55092 KB Output is correct
64 Correct 190 ms 55100 KB Output is correct
65 Correct 189 ms 55160 KB Output is correct
66 Correct 188 ms 55100 KB Output is correct
67 Correct 197 ms 50932 KB Output is correct
68 Correct 197 ms 50052 KB Output is correct
69 Correct 206 ms 44852 KB Output is correct
70 Correct 193 ms 42852 KB Output is correct
71 Correct 1 ms 204 KB Output is correct
72 Correct 5 ms 1608 KB Output is correct
73 Correct 6 ms 1740 KB Output is correct
74 Correct 6 ms 1884 KB Output is correct
75 Correct 5 ms 1484 KB Output is correct
76 Correct 6 ms 1740 KB Output is correct
77 Correct 5 ms 1740 KB Output is correct
78 Correct 6 ms 1612 KB Output is correct
79 Correct 6 ms 1688 KB Output is correct
80 Correct 191 ms 48292 KB Output is correct
81 Correct 197 ms 42904 KB Output is correct
82 Correct 194 ms 49864 KB Output is correct
83 Correct 199 ms 54020 KB Output is correct
84 Correct 4 ms 1356 KB Output is correct
85 Correct 4 ms 1228 KB Output is correct
86 Correct 4 ms 1356 KB Output is correct
87 Correct 7 ms 1424 KB Output is correct
88 Correct 5 ms 1484 KB Output is correct
89 Correct 5 ms 1356 KB Output is correct
90 Correct 5 ms 1356 KB Output is correct
91 Correct 6 ms 1740 KB Output is correct
92 Correct 5 ms 1484 KB Output is correct
93 Correct 5 ms 1356 KB Output is correct
94 Correct 1 ms 332 KB Output is correct
95 Correct 1 ms 332 KB Output is correct
96 Correct 1 ms 332 KB Output is correct
97 Correct 1 ms 332 KB Output is correct
98 Correct 1 ms 332 KB Output is correct
99 Correct 1 ms 332 KB Output is correct
100 Correct 1 ms 332 KB Output is correct
101 Correct 1 ms 332 KB Output is correct
102 Correct 1 ms 332 KB Output is correct
103 Correct 1 ms 332 KB Output is correct
104 Correct 16 ms 4840 KB Output is correct
105 Correct 34 ms 12004 KB Output is correct
106 Correct 1 ms 460 KB Output is correct
107 Correct 65 ms 19652 KB Output is correct
108 Correct 82 ms 25668 KB Output is correct
109 Correct 2 ms 588 KB Output is correct
110 Correct 120 ms 31612 KB Output is correct
111 Correct 140 ms 42468 KB Output is correct
112 Correct 2 ms 716 KB Output is correct
113 Correct 187 ms 59872 KB Output is correct
114 Correct 197 ms 52548 KB Output is correct
115 Correct 198 ms 52656 KB Output is correct
116 Correct 198 ms 52456 KB Output is correct
117 Correct 201 ms 52768 KB Output is correct
118 Correct 216 ms 52232 KB Output is correct
119 Runtime error 154 ms 65540 KB Execution killed with signal 9
120 Halted 0 ms 0 KB -