답안 #108419

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
108419 2019-04-29T06:56:26 Z rajarshi_basu Aliens (IOI16_aliens) C++14
25 / 100
2000 ms 371604 KB
#include <iostream>
#include <vector>
#include <set>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <complex>
#include <chrono>
#include <random>
#include <stack>
#include <set>
#include <fstream>

#define FOR(i,n) for(int i = 0;i < n; i++)
#define FORE(i,a,b) for(int i = a; i <= b ; i++)
#define ss second
#define ff first
#define ll long long int
#define ii pair<ll,ll>
#define il pair<int,ll>
#define li pair<ll,int>
#define x ff
#define y ss
#define lii pair<ll,pair<int,int> > 
#define piil pair<int ,pair<int,int> > 
#define iii pair<pair<int,int>,int> 
#define pll pair<ll,ll>
#define vi vector<int>
#define pb push_back
#define mp make_pair

#include "aliens.h"

using namespace std;

const ll INF = 1e18;

vector<ii> all;

vector<ii> reduceList(vector<ii> v){
	sort(v.begin(), v.end());
	vector<ii> res;
	ll mx = 0;
	for(auto e:v){

		if(res.empty())res.pb(e);
		else if(res.back().ff < e.ff){
			if(e.ss > mx)res.pb(e);
		}else{
			res.back() = e;
		}
		mx = max(mx,e.ss);
	}
	return res;
}

vector<ii> createRanges(vi r,vi c,int n){
	vector<ii> all;
	FOR(i,n)all.pb({min(r[i],c[i]),max(r[i],c[i])});
	return all;
}

ll C1[50*1000+1];
void prec(){
	C1[0] = 0;	
	FORE(i,1,(int)all.size()-1){
		C1[i] = max((ll)0,all[i-1].ss - all[i].ff+1);
		C1[i] *= C1[i];
	}
}

ll cost(int t,int i){
	i--;
	ll t1 = all[i].ss - all[t].ff + 1; t1*=t1;
	ll t2 = C1[t];
	return t1 - t2;
}

class Segtree{    
    int n;
    struct Node{
        Node* left;
        Node* right;
        pll p;
        Node(){
            left = NULL;
            right = NULL;
            p = {1e9,1e9};
        }
    };

    Node* head;
    inline void expand(Node*& nd){
        if(nd == NULL)nd = new Node();
    }

    inline ll eval(pll p,ll x){
        return p.ff*x+ p.ss;
    }

    inline double intersect(pll p1,pll p2){
        return (p1.ss-p2.ss)*1.0/(p2.ff-p1.ff);
    }

    void update(Node*& node,int ss,int se,pll ln){
        expand(node);
        if(ss == se){
            if(eval(ln,ss) < eval(node->p,ss)){
                node->p = ln;
            }
            return;
        }
        ll v1 = eval(ln,ss);
        ll v2 = eval(ln,se);
        ll v3 = eval(node->p,ss);
        ll v4 = eval(node->p,se);
        if(v1 <= v3 and v2 <= v4){
            node->p = ln;
            return;
        }else if(v3 <= v1 and v4 <= v2){
            return;
        }
        int mid = (ss+se)/2;
        update(node->left,ss,mid,ln);
        update(node->right,mid+1,se,ln);
    }
    ll query(Node* node,int ss,int se,int i){
        if(node == NULL) return INF;
        if(i > se or i < ss)return INF;
        if(ss == se){
            return eval(node->p,i);
        }
        int mid = (ss+se)/2;
        return min(min(eval(node->p,i),query(node->left,ss,mid,i)),query(node->right,mid+1,se,i));
    }

    public : 
    Segtree(){
       
        head = new Node();
    }
    inline void addLine(ll m,ll c){
        update(head,0,1e6+1,{m,c});
    }

    inline ll query(ll x){
        return query(head,0,1e6+1,x);
    }
};

ll dp[50*1000+1][2];
//int opt[50*1000+1][2];
//Segtree ds[50*1000+1];
void computeDp(int k){
	int n = all.size();
	k = min(n,k);
	FOR(i,n+1)dp[i][0] = INF;
	dp[0][0] = 0;
	vector<pll> lns;
	vector<ll> add;
	FOR(i,n){
		add.pb(all[i].ss*all[i].ss + 1 + 2*all[i].ss);
	}
	FOR(j,k+1){
		if(j == 0)continue;
		dp[0][1] = 0;
		
		Segtree ds;
		FORE(t,1,n){
			ds.addLine((-2*all[t-1].ff),(dp[t-1][0] - C1[t-1] + all[t-1].ff*all[t-1].ff - 2*all[t-1].ff));
		}
		for(int i = n;i>=1;i--){
			//ll add = 
			ll mn = ds.query(all[i-1].ss);
			dp[i][1] = mn + add[i-1];
			continue;
		}
		FOR(i,n)dp[i][0] = dp[i][1];//,opt[i][0]= opt[i][1];
	}
}

ll take_photos(int n,int m,int k,vi r,vi c){
	all = reduceList(createRanges(r,c,n));
	prec();
	//for(auto e:all)cout << e.ff<< ";"<<e.ss << endl;
	computeDp(k);/*
	FOR(i,min((int)all.size(),k)+1){
	FOR(j,all.size()+1){
		cout << dp[i][j] << " ";
	};cout << endl;}*/
	return dp[all.size()][1];
	//return 0;
}


/*
int main(){
	//int a[2] = {2,4,4,4,4};
	//int b[2] = {3,5,6,5,6};
	vi a;
	vi b;
	a.pb(1);a.pb(4);
	b.pb(6);b.pb(7);
	cout << take_photos(2,7,2,a,b) << endl;
	return 0;
}

*/
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 256 KB Correct answer: answer = 12
5 Correct 2 ms 256 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 256 KB Correct answer: answer = 7696
9 Correct 2 ms 384 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 3 ms 512 KB Correct answer: answer = 151
14 Correct 3 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 3 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 384 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 3 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Correct answer: answer = 1
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 1
4 Correct 2 ms 256 KB Correct answer: answer = 5
5 Correct 2 ms 256 KB Correct answer: answer = 41
6 Correct 2 ms 384 KB Correct answer: answer = 71923
7 Correct 3 ms 384 KB Correct answer: answer = 77137
8 Correct 43 ms 6776 KB Correct answer: answer = 764
9 Correct 2 ms 384 KB Correct answer: answer = 250000
10 Correct 108 ms 11356 KB Correct answer: answer = 500
11 Correct 2 ms 256 KB Correct answer: answer = 32
12 Correct 3 ms 384 KB Correct answer: answer = 130050
13 Correct 11 ms 1408 KB Correct answer: answer = 5110
14 Correct 4 ms 640 KB Correct answer: answer = 2626
15 Correct 10 ms 1280 KB Correct answer: answer = 796
16 Correct 8 ms 1152 KB Correct answer: answer = 7580
17 Correct 42 ms 3320 KB Correct answer: answer = 1904
18 Correct 3 ms 512 KB Correct answer: answer = 996004
19 Correct 5 ms 640 KB Correct answer: answer = 38817
20 Correct 16 ms 2560 KB Correct answer: answer = 4096
21 Correct 3 ms 384 KB Correct answer: answer = 1
22 Correct 3 ms 384 KB Correct answer: answer = 1
23 Correct 24 ms 3060 KB Correct answer: answer = 2040
24 Correct 2 ms 384 KB Correct answer: answer = 2
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 256 KB Correct answer: answer = 12
5 Correct 2 ms 256 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 256 KB Correct answer: answer = 7696
9 Correct 2 ms 384 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 3 ms 512 KB Correct answer: answer = 151
14 Correct 3 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 3 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 384 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 3 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 256 KB Correct answer: answer = 5
25 Correct 2 ms 256 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 3 ms 384 KB Correct answer: answer = 77137
28 Correct 43 ms 6776 KB Correct answer: answer = 764
29 Correct 2 ms 384 KB Correct answer: answer = 250000
30 Correct 108 ms 11356 KB Correct answer: answer = 500
31 Correct 2 ms 256 KB Correct answer: answer = 32
32 Correct 3 ms 384 KB Correct answer: answer = 130050
33 Correct 11 ms 1408 KB Correct answer: answer = 5110
34 Correct 4 ms 640 KB Correct answer: answer = 2626
35 Correct 10 ms 1280 KB Correct answer: answer = 796
36 Correct 8 ms 1152 KB Correct answer: answer = 7580
37 Correct 42 ms 3320 KB Correct answer: answer = 1904
38 Correct 3 ms 512 KB Correct answer: answer = 996004
39 Correct 5 ms 640 KB Correct answer: answer = 38817
40 Correct 16 ms 2560 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 3 ms 384 KB Correct answer: answer = 1
43 Correct 24 ms 3060 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 256 KB Correct answer: answer = 4
46 Correct 2 ms 256 KB Correct answer: answer = 9
47 Correct 2 ms 256 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 3 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 380 KB Correct answer: answer = 997310
54 Correct 3 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 3 ms 384 KB Correct answer: answer = 484
58 Correct 3 ms 512 KB Correct answer: answer = 63501
59 Correct 6 ms 768 KB Correct answer: answer = 323501
60 Correct 22 ms 2652 KB Correct answer: answer = 752500
61 Correct 7 ms 640 KB Correct answer: answer = 761480
62 Correct 20 ms 3320 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 106 ms 11532 KB Correct answer: answer = 750500
65 Correct 2 ms 512 KB Correct answer: answer = 1000000
66 Correct 3 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 2 ms 384 KB Correct answer: answer = 994009
70 Correct 4 ms 512 KB Correct answer: answer = 59315
71 Correct 8 ms 1536 KB Correct answer: answer = 25454
72 Correct 20 ms 2688 KB Correct answer: answer = 1504
73 Correct 4 ms 512 KB Correct answer: answer = 37486
74 Correct 15 ms 2304 KB Correct answer: answer = 4284
75 Correct 2 ms 512 KB Correct answer: answer = 158008
76 Correct 6 ms 896 KB Correct answer: answer = 51860
77 Correct 4 ms 640 KB Correct answer: answer = 12985
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 256 KB Correct answer: answer = 12
5 Correct 2 ms 256 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 256 KB Correct answer: answer = 7696
9 Correct 2 ms 384 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 3 ms 512 KB Correct answer: answer = 151
14 Correct 3 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 3 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 384 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 3 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 256 KB Correct answer: answer = 5
25 Correct 2 ms 256 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 3 ms 384 KB Correct answer: answer = 77137
28 Correct 43 ms 6776 KB Correct answer: answer = 764
29 Correct 2 ms 384 KB Correct answer: answer = 250000
30 Correct 108 ms 11356 KB Correct answer: answer = 500
31 Correct 2 ms 256 KB Correct answer: answer = 32
32 Correct 3 ms 384 KB Correct answer: answer = 130050
33 Correct 11 ms 1408 KB Correct answer: answer = 5110
34 Correct 4 ms 640 KB Correct answer: answer = 2626
35 Correct 10 ms 1280 KB Correct answer: answer = 796
36 Correct 8 ms 1152 KB Correct answer: answer = 7580
37 Correct 42 ms 3320 KB Correct answer: answer = 1904
38 Correct 3 ms 512 KB Correct answer: answer = 996004
39 Correct 5 ms 640 KB Correct answer: answer = 38817
40 Correct 16 ms 2560 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 3 ms 384 KB Correct answer: answer = 1
43 Correct 24 ms 3060 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 256 KB Correct answer: answer = 4
46 Correct 2 ms 256 KB Correct answer: answer = 9
47 Correct 2 ms 256 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 3 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 380 KB Correct answer: answer = 997310
54 Correct 3 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 3 ms 384 KB Correct answer: answer = 484
58 Correct 3 ms 512 KB Correct answer: answer = 63501
59 Correct 6 ms 768 KB Correct answer: answer = 323501
60 Correct 22 ms 2652 KB Correct answer: answer = 752500
61 Correct 7 ms 640 KB Correct answer: answer = 761480
62 Correct 20 ms 3320 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 106 ms 11532 KB Correct answer: answer = 750500
65 Correct 2 ms 512 KB Correct answer: answer = 1000000
66 Correct 3 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 2 ms 384 KB Correct answer: answer = 994009
70 Correct 4 ms 512 KB Correct answer: answer = 59315
71 Correct 8 ms 1536 KB Correct answer: answer = 25454
72 Correct 20 ms 2688 KB Correct answer: answer = 1504
73 Correct 4 ms 512 KB Correct answer: answer = 37486
74 Correct 15 ms 2304 KB Correct answer: answer = 4284
75 Correct 2 ms 512 KB Correct answer: answer = 158008
76 Correct 6 ms 896 KB Correct answer: answer = 51860
77 Correct 4 ms 640 KB Correct answer: answer = 12985
78 Correct 4 ms 512 KB Correct answer: answer = 997864126212
79 Correct 4 ms 512 KB Correct answer: answer = 998608411647
80 Correct 4 ms 600 KB Correct answer: answer = 995265560477
81 Correct 8 ms 768 KB Correct answer: answer = 10125000
82 Correct 12 ms 1664 KB Correct answer: answer = 2291668
83 Correct 89 ms 9352 KB Correct answer: answer = 42388
84 Correct 349 ms 36344 KB Correct answer: answer = 10318
85 Correct 1196 ms 120264 KB Correct answer: answer = 3416
86 Correct 5 ms 640 KB Correct answer: answer = 331708193881
87 Correct 254 ms 36216 KB Correct answer: answer = 2861193756
88 Execution timed out 2037 ms 371604 KB Time limit exceeded
89 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 256 KB Correct answer: answer = 12
5 Correct 2 ms 256 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 256 KB Correct answer: answer = 7696
9 Correct 2 ms 384 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 3 ms 512 KB Correct answer: answer = 151
14 Correct 3 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 3 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 384 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 3 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 256 KB Correct answer: answer = 5
25 Correct 2 ms 256 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 3 ms 384 KB Correct answer: answer = 77137
28 Correct 43 ms 6776 KB Correct answer: answer = 764
29 Correct 2 ms 384 KB Correct answer: answer = 250000
30 Correct 108 ms 11356 KB Correct answer: answer = 500
31 Correct 2 ms 256 KB Correct answer: answer = 32
32 Correct 3 ms 384 KB Correct answer: answer = 130050
33 Correct 11 ms 1408 KB Correct answer: answer = 5110
34 Correct 4 ms 640 KB Correct answer: answer = 2626
35 Correct 10 ms 1280 KB Correct answer: answer = 796
36 Correct 8 ms 1152 KB Correct answer: answer = 7580
37 Correct 42 ms 3320 KB Correct answer: answer = 1904
38 Correct 3 ms 512 KB Correct answer: answer = 996004
39 Correct 5 ms 640 KB Correct answer: answer = 38817
40 Correct 16 ms 2560 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 3 ms 384 KB Correct answer: answer = 1
43 Correct 24 ms 3060 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 256 KB Correct answer: answer = 4
46 Correct 2 ms 256 KB Correct answer: answer = 9
47 Correct 2 ms 256 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 3 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 380 KB Correct answer: answer = 997310
54 Correct 3 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 3 ms 384 KB Correct answer: answer = 484
58 Correct 3 ms 512 KB Correct answer: answer = 63501
59 Correct 6 ms 768 KB Correct answer: answer = 323501
60 Correct 22 ms 2652 KB Correct answer: answer = 752500
61 Correct 7 ms 640 KB Correct answer: answer = 761480
62 Correct 20 ms 3320 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 106 ms 11532 KB Correct answer: answer = 750500
65 Correct 2 ms 512 KB Correct answer: answer = 1000000
66 Correct 3 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 2 ms 384 KB Correct answer: answer = 994009
70 Correct 4 ms 512 KB Correct answer: answer = 59315
71 Correct 8 ms 1536 KB Correct answer: answer = 25454
72 Correct 20 ms 2688 KB Correct answer: answer = 1504
73 Correct 4 ms 512 KB Correct answer: answer = 37486
74 Correct 15 ms 2304 KB Correct answer: answer = 4284
75 Correct 2 ms 512 KB Correct answer: answer = 158008
76 Correct 6 ms 896 KB Correct answer: answer = 51860
77 Correct 4 ms 640 KB Correct answer: answer = 12985
78 Correct 4 ms 512 KB Correct answer: answer = 997864126212
79 Correct 4 ms 512 KB Correct answer: answer = 998608411647
80 Correct 4 ms 600 KB Correct answer: answer = 995265560477
81 Correct 8 ms 768 KB Correct answer: answer = 10125000
82 Correct 12 ms 1664 KB Correct answer: answer = 2291668
83 Correct 89 ms 9352 KB Correct answer: answer = 42388
84 Correct 349 ms 36344 KB Correct answer: answer = 10318
85 Correct 1196 ms 120264 KB Correct answer: answer = 3416
86 Correct 5 ms 640 KB Correct answer: answer = 331708193881
87 Correct 254 ms 36216 KB Correct answer: answer = 2861193756
88 Execution timed out 2037 ms 371604 KB Time limit exceeded
89 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 256 KB Correct answer: answer = 12
5 Correct 2 ms 256 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 256 KB Correct answer: answer = 7696
9 Correct 2 ms 384 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 3 ms 512 KB Correct answer: answer = 151
14 Correct 3 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 3 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 384 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 3 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 256 KB Correct answer: answer = 5
25 Correct 2 ms 256 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 3 ms 384 KB Correct answer: answer = 77137
28 Correct 43 ms 6776 KB Correct answer: answer = 764
29 Correct 2 ms 384 KB Correct answer: answer = 250000
30 Correct 108 ms 11356 KB Correct answer: answer = 500
31 Correct 2 ms 256 KB Correct answer: answer = 32
32 Correct 3 ms 384 KB Correct answer: answer = 130050
33 Correct 11 ms 1408 KB Correct answer: answer = 5110
34 Correct 4 ms 640 KB Correct answer: answer = 2626
35 Correct 10 ms 1280 KB Correct answer: answer = 796
36 Correct 8 ms 1152 KB Correct answer: answer = 7580
37 Correct 42 ms 3320 KB Correct answer: answer = 1904
38 Correct 3 ms 512 KB Correct answer: answer = 996004
39 Correct 5 ms 640 KB Correct answer: answer = 38817
40 Correct 16 ms 2560 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 3 ms 384 KB Correct answer: answer = 1
43 Correct 24 ms 3060 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 256 KB Correct answer: answer = 4
46 Correct 2 ms 256 KB Correct answer: answer = 9
47 Correct 2 ms 256 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 3 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 380 KB Correct answer: answer = 997310
54 Correct 3 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 3 ms 384 KB Correct answer: answer = 484
58 Correct 3 ms 512 KB Correct answer: answer = 63501
59 Correct 6 ms 768 KB Correct answer: answer = 323501
60 Correct 22 ms 2652 KB Correct answer: answer = 752500
61 Correct 7 ms 640 KB Correct answer: answer = 761480
62 Correct 20 ms 3320 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 106 ms 11532 KB Correct answer: answer = 750500
65 Correct 2 ms 512 KB Correct answer: answer = 1000000
66 Correct 3 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 2 ms 384 KB Correct answer: answer = 994009
70 Correct 4 ms 512 KB Correct answer: answer = 59315
71 Correct 8 ms 1536 KB Correct answer: answer = 25454
72 Correct 20 ms 2688 KB Correct answer: answer = 1504
73 Correct 4 ms 512 KB Correct answer: answer = 37486
74 Correct 15 ms 2304 KB Correct answer: answer = 4284
75 Correct 2 ms 512 KB Correct answer: answer = 158008
76 Correct 6 ms 896 KB Correct answer: answer = 51860
77 Correct 4 ms 640 KB Correct answer: answer = 12985
78 Correct 4 ms 512 KB Correct answer: answer = 997864126212
79 Correct 4 ms 512 KB Correct answer: answer = 998608411647
80 Correct 4 ms 600 KB Correct answer: answer = 995265560477
81 Correct 8 ms 768 KB Correct answer: answer = 10125000
82 Correct 12 ms 1664 KB Correct answer: answer = 2291668
83 Correct 89 ms 9352 KB Correct answer: answer = 42388
84 Correct 349 ms 36344 KB Correct answer: answer = 10318
85 Correct 1196 ms 120264 KB Correct answer: answer = 3416
86 Correct 5 ms 640 KB Correct answer: answer = 331708193881
87 Correct 254 ms 36216 KB Correct answer: answer = 2861193756
88 Execution timed out 2037 ms 371604 KB Time limit exceeded
89 Halted 0 ms 0 KB -