Submission #463738

# Submission time Handle Problem Language Result Execution time Memory
463738 2021-08-11T16:50:07 Z PedroBigMan Shortcut (IOI16_shortcut) C++14
38 / 100
2000 ms 198392 KB
#include "shortcut.h"
/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#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>
#include <cstring>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=(ll) a; i<(ll) 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 500000000000000000LL
#define EPS 0.00000001
#define pi 3.14159
ll mod=1000000007LL;

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);}} 

template<class T=ll>
class SparseTable //Range Minimum Queries
{
    public:
    ll N; 
    vector<T> a;
    vector<vector<T> > v;
    
    SparseTable() {N=0LL;}
    SparseTable(vector<T> b)
    {
        a=b; N=a.size();
        ll lo=(ll) floor((double) log2(N)) +1LL;
        vector<T> xx; 
        REP(i,0,lo) {xx.pb(0LL);} REP(i,0,N) {v.pb(xx);}
        REP(step,0LL,lo)
        {
            REP(i,0,N-(1LL<<step)+1LL)
            {
                if(step==0) {v[i][0]=a[i];}
                else {v[i][step]=max(v[i][step-1],v[i+(1LL<<(step-1))][step-1]);}
            }
        }
    }
    
    T query(ll l, ll r)
    {
		if(l>r) {return (-INF);}
        ll step=(ll) floor((double) log2(r-l+1LL));
        return max(v[l][step],v[r-(1LL<<step)+1LL][step]);
    }
};

vector<ll> ps;

ll D(ll i, ll j) {return (ps[j]-ps[i]);}

class ST
{
    public:
    ll N;
    
    ll neuts; 
    
    vector<ll> p;
    vector<pl> range;
    
    ST() {N=0LL;}
    ST(vector<ll> arr)
    {
		neuts=-INF;
        N = (ll) 1<<(ll) ceil(log2(arr.size()));
        REP(i,0,2*N) {range.pb(mp(0LL,0LL));}
        REP(i,0,N) {p.pb(neuts);}
        REP(i,0,arr.size()) {p.pb(arr[i]); range[i+N]=mp(i,i);}
        REP(i,arr.size(),N) {p.pb(neuts); range[i+N]=mp(i,i);}
        ll cur = N-1;
        while(cur>0)
        {
            p[cur]=max(p[2*cur],p[2*cur+1]);
            range[cur]=mp(range[2*cur].ff,range[2*cur+1].ss);
            cur--;
        }
    }
    
    ll query(ll a,ll b, ll c=1LL) //range [a,b], current node. initially: query(a,b)
    {
        ll x=range[c].ff; ll y=range[c].ss;
        if(y<a || x>b) {return neuts;}
        if(x>=a && y<=b) {return p[c];}
        ll ans = max(query(a,b,2*c),query(a,b,2*c+1));
        return ans;
    }
    
    void update(ll s, ll a, ll c=1LL) //update LV, range [a,b], current node, current range. initially: update(s,a,b)
    {
        ll x=range[c].ff; ll y=range[c].ss;
        if(y<a || x>a) {return ;}
        if(x==a && y==a) 
        {
            p[c]+=s;
            return;
        }
        update(s,a,2*c); update(s,a,2*c+1);
        p[c]=max(p[2*c],p[2*c+1]);
    }
};


ll find_shortcut(int n, vector<int> lll, vector<int> ddd, int ccc)
{
	ll N = (ll) n; vector<ll> l,d; ll c = (ll) ccc;
	REP(i,0,N-1) {l.pb((ll) lll[i]);} REP(i,0,N) {d.pb((ll) ddd[i]);}
	vector<ll> d1,d2; ll cursum;
	cursum=0LL; REP(i,0,N) {d1.pb(cursum+d[i]); if(i!=N-1) {cursum+=l[i];}}
	REP(i,0,N) {d2.pb(cursum+d[i]); if(i!=N-1) {cursum-=l[i];}}
	SparseTable<ll> D1(d1); SparseTable<ll> D2(d2);
	cursum=0LL; ps.pb(0LL); REP(i,0,N-1) {cursum+=l[i]; ps.pb(cursum);}
	vector<pair<ll,pl> > ToOrder;
	REP(i,0,N)
	{
		REP(j,i+1,N)
		{
			ToOrder.pb({D(i,j),{i,j}});
		}
	}
	sort(whole(ToOrder));
	ll counterT=0LL; //counter relative to array ToOrder
	vector<ll> counter; REP(i,0,N) {counter.pb(i);}
	vector<ll> xx; REP(i,0,N) {xx.pb(0LL);}
	ST S1(xx); ST S2(xx);
	ll val;
	REP(i,0,N)
	{
		val=S2.query(i,i);
		S2.update(d[i]+D2.query(counter[i]+1,N-1)-D(i,N-1)-val,i);
	}
	ll ans=0LL;
	REP(i,0,N)
	{
		REP(j,i+1,N) 
		{
			ans=max(ans,D(i,j)+d[i]+d[j]);
		}
	}
	ll diam=ans;
	ll curdiam1,curdiam2,curdiam3,curdiam4,curdiam5,curdiam6,curdiam;
	vector<ll> bbeg,eend;
	ll vv;
	REP(i,0,N)
	{
		vv=0LL;
		REP(j,0,i) {vv=max(vv,D(j,i)+d[j]+d[i]);}
		bbeg.pb(vv);
	}
	REP(i,0,N)
	{
		vv=0LL;
		REP(j,i+1,N) {vv=max(vv,D(i,j)+d[i]+d[j]);}
		eend.pb(vv);
	}
	SparseTable<ll> BEG(bbeg); SparseTable<ll> END(eend);
	REP(pos,0,ToOrder.size())
	{
		ll i=ToOrder[pos].ss.ff; ll j = ToOrder[pos].ss.ss;
		ll DD = (D(i,j)+c)/2LL; 
		while(counterT<ToOrder.size() && ToOrder[counterT].ff<=DD)
		{
			ll a = ToOrder[counterT].ss.ff; ll b = ToOrder[counterT].ss.ss;
			counter[a]=b;
			val = S1.query(a,a);
			S1.update(d[a]+D1.query(a+1LL,counter[a])-D(0,a)-val,a);
			val = S2.query(a,a);
			S2.update(d[a]+D2.query(counter[a]+1,N-1)-D(a,N-1)-val,a);
			counterT++;
		}
		if(c>=D(i,j)) {continue;}
		curdiam1 = c + (D1.query(j+1,N-1) - D(0,j)) + (D2.query(0,i-1) - D(i,N-1));
		ll xmin = (ll) (lower_bound(whole(ps),ps[j]-DD) - ps.begin());
		curdiam2 = max(D2.query(xmin,j)-D(j,N-1),D1.query(i,xmin-1)-D(0,i)+c)+(D1.query(j+1,N-1)-D(0,j)); //a inside, b outside
		ll xmax = (ll) (upper_bound(whole(ps),ps[i]+DD) - ps.begin()) -1LL;
		curdiam3 = max(D1.query(i,xmax)-D(0,i),D2.query(xmax+1,j)-D(j,N-1)+c)+(D2.query(0,i-1)-D(i,N-1)); //a outside, b inside
		curdiam4 = max(S1.query(i,j),S2.query(i,j)+c+D(i,j));
		curdiam5 = BEG.query(0,i-1); curdiam6 = END.query(j+1,N-1);
		curdiam=max(max(max(curdiam1,curdiam2),max(curdiam3,curdiam4)),max(curdiam5,curdiam6));
		ans=min(ans,curdiam);
	}
	return ans;
}

Compilation message

shortcut.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    6 | #pragma GCC optimization ("O3")
      | 
shortcut.cpp:7: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    7 | #pragma GCC optimization ("unroll-loops")
      | 
shortcut.cpp: In function 'll find_shortcut(int, std::vector<int>, std::vector<int>, int)':
shortcut.cpp:194:17: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<std::pair<long long int, std::pair<long long int, long long int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  194 |   while(counterT<ToOrder.size() && ToOrder[counterT].ff<=DD)
      |         ~~~~~~~~^~~~~~~~~~~~~~~
shortcut.cpp:173:5: warning: unused variable 'diam' [-Wunused-variable]
  173 |  ll diam=ans;
      |     ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
73 Correct 40 ms 1228 KB n = 250, 25037 is a correct answer
74 Correct 37 ms 1228 KB n = 250, 199047242 is a correct answer
75 Correct 39 ms 1228 KB n = 250, 61231537449 is a correct answer
76 Correct 39 ms 1228 KB n = 250, 126000000001 is a correct answer
77 Correct 39 ms 1228 KB n = 250, 127000000000 is a correct answer
78 Correct 21 ms 1228 KB n = 250, 2123470094 is a correct answer
79 Correct 22 ms 1228 KB n = 250, 6545 is a correct answer
80 Correct 30 ms 1228 KB n = 250, 6731 is a correct answer
81 Correct 8 ms 588 KB n = 108, 15322 is a correct answer
82 Correct 39 ms 1228 KB n = 250, 39952 is a correct answer
83 Correct 37 ms 1228 KB n = 250, 41156 is a correct answer
84 Correct 36 ms 1228 KB n = 250, 12881 is a correct answer
85 Correct 39 ms 1228 KB n = 250, 213812 is a correct answer
86 Correct 39 ms 1228 KB n = 250, 194188 is a correct answer
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
73 Correct 40 ms 1228 KB n = 250, 25037 is a correct answer
74 Correct 37 ms 1228 KB n = 250, 199047242 is a correct answer
75 Correct 39 ms 1228 KB n = 250, 61231537449 is a correct answer
76 Correct 39 ms 1228 KB n = 250, 126000000001 is a correct answer
77 Correct 39 ms 1228 KB n = 250, 127000000000 is a correct answer
78 Correct 21 ms 1228 KB n = 250, 2123470094 is a correct answer
79 Correct 22 ms 1228 KB n = 250, 6545 is a correct answer
80 Correct 30 ms 1228 KB n = 250, 6731 is a correct answer
81 Correct 8 ms 588 KB n = 108, 15322 is a correct answer
82 Correct 39 ms 1228 KB n = 250, 39952 is a correct answer
83 Correct 37 ms 1228 KB n = 250, 41156 is a correct answer
84 Correct 36 ms 1228 KB n = 250, 12881 is a correct answer
85 Correct 39 ms 1228 KB n = 250, 213812 is a correct answer
86 Correct 39 ms 1228 KB n = 250, 194188 is a correct answer
87 Correct 154 ms 3648 KB n = 500, 199300822 is a correct answer
88 Correct 175 ms 3624 KB n = 500, 127613044387 is a correct answer
89 Correct 163 ms 3648 KB n = 500, 251000000001 is a correct answer
90 Correct 164 ms 3648 KB n = 500, 252000000000 is a correct answer
91 Correct 178 ms 3648 KB n = 500, 199378978 is a correct answer
92 Correct 188 ms 3648 KB n = 500, 199551149 is a correct answer
93 Correct 78 ms 3524 KB n = 400, 7177 is a correct answer
94 Correct 94 ms 3524 KB n = 400, 10067 is a correct answer
95 Correct 171 ms 3648 KB n = 500, 198631068 is a correct answer
96 Correct 82 ms 3524 KB n = 400, 10814 is a correct answer
97 Correct 107 ms 3576 KB n = 400, 9141 is a correct answer
98 Correct 121 ms 3648 KB n = 500, 5699 is a correct answer
99 Correct 158 ms 3648 KB n = 500, 13504 is a correct answer
100 Correct 182 ms 3648 KB n = 500, 31507 is a correct answer
101 Correct 95 ms 3648 KB n = 500, 199425296 is a correct answer
102 Correct 184 ms 3648 KB n = 500, 198990259 is a correct answer
103 Correct 179 ms 3648 KB n = 500, 486155 is a correct answer
104 Correct 179 ms 3648 KB n = 500, 256468 is a correct answer
105 Correct 184 ms 3648 KB n = 500, 309873 is a correct answer
106 Correct 193 ms 3648 KB n = 500, 434764 is a correct answer
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
73 Correct 40 ms 1228 KB n = 250, 25037 is a correct answer
74 Correct 37 ms 1228 KB n = 250, 199047242 is a correct answer
75 Correct 39 ms 1228 KB n = 250, 61231537449 is a correct answer
76 Correct 39 ms 1228 KB n = 250, 126000000001 is a correct answer
77 Correct 39 ms 1228 KB n = 250, 127000000000 is a correct answer
78 Correct 21 ms 1228 KB n = 250, 2123470094 is a correct answer
79 Correct 22 ms 1228 KB n = 250, 6545 is a correct answer
80 Correct 30 ms 1228 KB n = 250, 6731 is a correct answer
81 Correct 8 ms 588 KB n = 108, 15322 is a correct answer
82 Correct 39 ms 1228 KB n = 250, 39952 is a correct answer
83 Correct 37 ms 1228 KB n = 250, 41156 is a correct answer
84 Correct 36 ms 1228 KB n = 250, 12881 is a correct answer
85 Correct 39 ms 1228 KB n = 250, 213812 is a correct answer
86 Correct 39 ms 1228 KB n = 250, 194188 is a correct answer
87 Correct 154 ms 3648 KB n = 500, 199300822 is a correct answer
88 Correct 175 ms 3624 KB n = 500, 127613044387 is a correct answer
89 Correct 163 ms 3648 KB n = 500, 251000000001 is a correct answer
90 Correct 164 ms 3648 KB n = 500, 252000000000 is a correct answer
91 Correct 178 ms 3648 KB n = 500, 199378978 is a correct answer
92 Correct 188 ms 3648 KB n = 500, 199551149 is a correct answer
93 Correct 78 ms 3524 KB n = 400, 7177 is a correct answer
94 Correct 94 ms 3524 KB n = 400, 10067 is a correct answer
95 Correct 171 ms 3648 KB n = 500, 198631068 is a correct answer
96 Correct 82 ms 3524 KB n = 400, 10814 is a correct answer
97 Correct 107 ms 3576 KB n = 400, 9141 is a correct answer
98 Correct 121 ms 3648 KB n = 500, 5699 is a correct answer
99 Correct 158 ms 3648 KB n = 500, 13504 is a correct answer
100 Correct 182 ms 3648 KB n = 500, 31507 is a correct answer
101 Correct 95 ms 3648 KB n = 500, 199425296 is a correct answer
102 Correct 184 ms 3648 KB n = 500, 198990259 is a correct answer
103 Correct 179 ms 3648 KB n = 500, 486155 is a correct answer
104 Correct 179 ms 3648 KB n = 500, 256468 is a correct answer
105 Correct 184 ms 3648 KB n = 500, 309873 is a correct answer
106 Correct 193 ms 3648 KB n = 500, 434764 is a correct answer
107 Execution timed out 2095 ms 198392 KB Time limit exceeded
108 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
73 Correct 40 ms 1228 KB n = 250, 25037 is a correct answer
74 Correct 37 ms 1228 KB n = 250, 199047242 is a correct answer
75 Correct 39 ms 1228 KB n = 250, 61231537449 is a correct answer
76 Correct 39 ms 1228 KB n = 250, 126000000001 is a correct answer
77 Correct 39 ms 1228 KB n = 250, 127000000000 is a correct answer
78 Correct 21 ms 1228 KB n = 250, 2123470094 is a correct answer
79 Correct 22 ms 1228 KB n = 250, 6545 is a correct answer
80 Correct 30 ms 1228 KB n = 250, 6731 is a correct answer
81 Correct 8 ms 588 KB n = 108, 15322 is a correct answer
82 Correct 39 ms 1228 KB n = 250, 39952 is a correct answer
83 Correct 37 ms 1228 KB n = 250, 41156 is a correct answer
84 Correct 36 ms 1228 KB n = 250, 12881 is a correct answer
85 Correct 39 ms 1228 KB n = 250, 213812 is a correct answer
86 Correct 39 ms 1228 KB n = 250, 194188 is a correct answer
87 Correct 154 ms 3648 KB n = 500, 199300822 is a correct answer
88 Correct 175 ms 3624 KB n = 500, 127613044387 is a correct answer
89 Correct 163 ms 3648 KB n = 500, 251000000001 is a correct answer
90 Correct 164 ms 3648 KB n = 500, 252000000000 is a correct answer
91 Correct 178 ms 3648 KB n = 500, 199378978 is a correct answer
92 Correct 188 ms 3648 KB n = 500, 199551149 is a correct answer
93 Correct 78 ms 3524 KB n = 400, 7177 is a correct answer
94 Correct 94 ms 3524 KB n = 400, 10067 is a correct answer
95 Correct 171 ms 3648 KB n = 500, 198631068 is a correct answer
96 Correct 82 ms 3524 KB n = 400, 10814 is a correct answer
97 Correct 107 ms 3576 KB n = 400, 9141 is a correct answer
98 Correct 121 ms 3648 KB n = 500, 5699 is a correct answer
99 Correct 158 ms 3648 KB n = 500, 13504 is a correct answer
100 Correct 182 ms 3648 KB n = 500, 31507 is a correct answer
101 Correct 95 ms 3648 KB n = 500, 199425296 is a correct answer
102 Correct 184 ms 3648 KB n = 500, 198990259 is a correct answer
103 Correct 179 ms 3648 KB n = 500, 486155 is a correct answer
104 Correct 179 ms 3648 KB n = 500, 256468 is a correct answer
105 Correct 184 ms 3648 KB n = 500, 309873 is a correct answer
106 Correct 193 ms 3648 KB n = 500, 434764 is a correct answer
107 Execution timed out 2095 ms 198392 KB Time limit exceeded
108 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
73 Correct 40 ms 1228 KB n = 250, 25037 is a correct answer
74 Correct 37 ms 1228 KB n = 250, 199047242 is a correct answer
75 Correct 39 ms 1228 KB n = 250, 61231537449 is a correct answer
76 Correct 39 ms 1228 KB n = 250, 126000000001 is a correct answer
77 Correct 39 ms 1228 KB n = 250, 127000000000 is a correct answer
78 Correct 21 ms 1228 KB n = 250, 2123470094 is a correct answer
79 Correct 22 ms 1228 KB n = 250, 6545 is a correct answer
80 Correct 30 ms 1228 KB n = 250, 6731 is a correct answer
81 Correct 8 ms 588 KB n = 108, 15322 is a correct answer
82 Correct 39 ms 1228 KB n = 250, 39952 is a correct answer
83 Correct 37 ms 1228 KB n = 250, 41156 is a correct answer
84 Correct 36 ms 1228 KB n = 250, 12881 is a correct answer
85 Correct 39 ms 1228 KB n = 250, 213812 is a correct answer
86 Correct 39 ms 1228 KB n = 250, 194188 is a correct answer
87 Correct 154 ms 3648 KB n = 500, 199300822 is a correct answer
88 Correct 175 ms 3624 KB n = 500, 127613044387 is a correct answer
89 Correct 163 ms 3648 KB n = 500, 251000000001 is a correct answer
90 Correct 164 ms 3648 KB n = 500, 252000000000 is a correct answer
91 Correct 178 ms 3648 KB n = 500, 199378978 is a correct answer
92 Correct 188 ms 3648 KB n = 500, 199551149 is a correct answer
93 Correct 78 ms 3524 KB n = 400, 7177 is a correct answer
94 Correct 94 ms 3524 KB n = 400, 10067 is a correct answer
95 Correct 171 ms 3648 KB n = 500, 198631068 is a correct answer
96 Correct 82 ms 3524 KB n = 400, 10814 is a correct answer
97 Correct 107 ms 3576 KB n = 400, 9141 is a correct answer
98 Correct 121 ms 3648 KB n = 500, 5699 is a correct answer
99 Correct 158 ms 3648 KB n = 500, 13504 is a correct answer
100 Correct 182 ms 3648 KB n = 500, 31507 is a correct answer
101 Correct 95 ms 3648 KB n = 500, 199425296 is a correct answer
102 Correct 184 ms 3648 KB n = 500, 198990259 is a correct answer
103 Correct 179 ms 3648 KB n = 500, 486155 is a correct answer
104 Correct 179 ms 3648 KB n = 500, 256468 is a correct answer
105 Correct 184 ms 3648 KB n = 500, 309873 is a correct answer
106 Correct 193 ms 3648 KB n = 500, 434764 is a correct answer
107 Execution timed out 2095 ms 198392 KB Time limit exceeded
108 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB n = 4, 80 is a correct answer
2 Correct 1 ms 204 KB n = 9, 110 is a correct answer
3 Correct 0 ms 204 KB n = 4, 21 is a correct answer
4 Correct 0 ms 204 KB n = 3, 4 is a correct answer
5 Correct 0 ms 204 KB n = 2, 62 is a correct answer
6 Correct 0 ms 204 KB n = 2, 3 is a correct answer
7 Correct 0 ms 204 KB n = 3, 29 is a correct answer
8 Correct 0 ms 204 KB n = 2, 3 is a correct answer
9 Correct 0 ms 204 KB n = 2, 3 is a correct answer
10 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
13 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
15 Correct 0 ms 204 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 204 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
18 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
19 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
20 Correct 1 ms 204 KB n = 5, 12 is a correct answer
21 Correct 1 ms 204 KB n = 5, 25 is a correct answer
22 Correct 0 ms 204 KB n = 2, 122 is a correct answer
23 Correct 1 ms 204 KB n = 10, 117 is a correct answer
24 Correct 1 ms 204 KB n = 10, 336 is a correct answer
25 Correct 1 ms 204 KB n = 10, 438 is a correct answer
26 Correct 1 ms 204 KB n = 10, 206 is a correct answer
27 Correct 1 ms 204 KB n = 10, 636 is a correct answer
28 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
29 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
30 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
31 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
32 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
33 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
34 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
35 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
36 Correct 6 ms 588 KB n = 100, 285 is a correct answer
37 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
38 Correct 5 ms 588 KB n = 100, 12161 is a correct answer
39 Correct 0 ms 204 KB n = 2, 62 is a correct answer
40 Correct 0 ms 204 KB n = 2, 3 is a correct answer
41 Correct 1 ms 204 KB n = 3, 29 is a correct answer
42 Correct 0 ms 204 KB n = 2, 3 is a correct answer
43 Correct 0 ms 204 KB n = 2, 3 is a correct answer
44 Correct 0 ms 204 KB n = 2, 2000000001 is a correct answer
45 Correct 1 ms 204 KB n = 2, 3000000000 is a correct answer
46 Correct 0 ms 204 KB n = 3, 3000000000 is a correct answer
47 Correct 1 ms 204 KB n = 3, 3000000000 is a correct answer
48 Correct 1 ms 204 KB n = 4, 3000000001 is a correct answer
49 Correct 1 ms 204 KB n = 4, 4000000000 is a correct answer
50 Correct 1 ms 204 KB n = 5, 4000000000 is a correct answer
51 Correct 1 ms 204 KB n = 10, 1000000343 is a correct answer
52 Correct 1 ms 204 KB n = 10, 3189 is a correct answer
53 Correct 0 ms 204 KB n = 10, 7000000000 is a correct answer
54 Correct 1 ms 204 KB n = 5, 12 is a correct answer
55 Correct 1 ms 204 KB n = 5, 25 is a correct answer
56 Correct 0 ms 204 KB n = 2, 122 is a correct answer
57 Correct 0 ms 204 KB n = 10, 117 is a correct answer
58 Correct 1 ms 204 KB n = 10, 336 is a correct answer
59 Correct 1 ms 204 KB n = 10, 438 is a correct answer
60 Correct 1 ms 204 KB n = 10, 206 is a correct answer
61 Correct 1 ms 204 KB n = 10, 636 is a correct answer
62 Correct 1 ms 204 KB n = 4, 2399 is a correct answer
63 Correct 1 ms 204 KB n = 10, 10992 is a correct answer
64 Correct 1 ms 204 KB n = 10, 3112 is a correct answer
65 Correct 6 ms 588 KB n = 100, 51000000001 is a correct answer
66 Correct 2 ms 332 KB n = 50, 197881272 is a correct answer
67 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
68 Correct 6 ms 588 KB n = 100, 20969 is a correct answer
69 Correct 6 ms 588 KB n = 100, 52000000000 is a correct answer
70 Correct 6 ms 588 KB n = 100, 285 is a correct answer
71 Correct 6 ms 588 KB n = 100, 21272 is a correct answer
72 Correct 6 ms 588 KB n = 100, 12161 is a correct answer
73 Correct 40 ms 1228 KB n = 250, 25037 is a correct answer
74 Correct 37 ms 1228 KB n = 250, 199047242 is a correct answer
75 Correct 39 ms 1228 KB n = 250, 61231537449 is a correct answer
76 Correct 39 ms 1228 KB n = 250, 126000000001 is a correct answer
77 Correct 39 ms 1228 KB n = 250, 127000000000 is a correct answer
78 Correct 21 ms 1228 KB n = 250, 2123470094 is a correct answer
79 Correct 22 ms 1228 KB n = 250, 6545 is a correct answer
80 Correct 30 ms 1228 KB n = 250, 6731 is a correct answer
81 Correct 8 ms 588 KB n = 108, 15322 is a correct answer
82 Correct 39 ms 1228 KB n = 250, 39952 is a correct answer
83 Correct 37 ms 1228 KB n = 250, 41156 is a correct answer
84 Correct 36 ms 1228 KB n = 250, 12881 is a correct answer
85 Correct 39 ms 1228 KB n = 250, 213812 is a correct answer
86 Correct 39 ms 1228 KB n = 250, 194188 is a correct answer
87 Correct 154 ms 3648 KB n = 500, 199300822 is a correct answer
88 Correct 175 ms 3624 KB n = 500, 127613044387 is a correct answer
89 Correct 163 ms 3648 KB n = 500, 251000000001 is a correct answer
90 Correct 164 ms 3648 KB n = 500, 252000000000 is a correct answer
91 Correct 178 ms 3648 KB n = 500, 199378978 is a correct answer
92 Correct 188 ms 3648 KB n = 500, 199551149 is a correct answer
93 Correct 78 ms 3524 KB n = 400, 7177 is a correct answer
94 Correct 94 ms 3524 KB n = 400, 10067 is a correct answer
95 Correct 171 ms 3648 KB n = 500, 198631068 is a correct answer
96 Correct 82 ms 3524 KB n = 400, 10814 is a correct answer
97 Correct 107 ms 3576 KB n = 400, 9141 is a correct answer
98 Correct 121 ms 3648 KB n = 500, 5699 is a correct answer
99 Correct 158 ms 3648 KB n = 500, 13504 is a correct answer
100 Correct 182 ms 3648 KB n = 500, 31507 is a correct answer
101 Correct 95 ms 3648 KB n = 500, 199425296 is a correct answer
102 Correct 184 ms 3648 KB n = 500, 198990259 is a correct answer
103 Correct 179 ms 3648 KB n = 500, 486155 is a correct answer
104 Correct 179 ms 3648 KB n = 500, 256468 is a correct answer
105 Correct 184 ms 3648 KB n = 500, 309873 is a correct answer
106 Correct 193 ms 3648 KB n = 500, 434764 is a correct answer
107 Execution timed out 2095 ms 198392 KB Time limit exceeded
108 Halted 0 ms 0 KB -