답안 #568747

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
568747 2022-05-26T07:01:53 Z tqbfjotld Fish 2 (JOI22_fish2) C++14
100 / 100
3519 ms 108640 KB
#include <bits/stdc++.h>
using namespace std;

const long long INF = 999999999999999999LL;

struct dat{
    vector<int> lblockvals;
    vector<int> lblockpos;
    vector<int> lblocknum;
    vector<long long> lblockpsum;
    vector<int> rblockvals;
    vector<int> rblockpos;
    vector<int> rblocknum;
    vector<long long> rblockpsum;
    int numfin;
    long long totsz;
    int len;
    dat(){
        numfin = 0;
        totsz = 0;
        len = 0;
    }
    dat(int num){
        numfin = 1;
        totsz = num;
        len = 1;
        lblockpos.push_back(0);
        lblocknum.push_back(0);
        lblockvals.push_back(num);
        lblockpsum.push_back(num);
        rblockpos.push_back(0);
        rblocknum.push_back(0);
        rblockvals.push_back(num);
        rblockpsum.push_back(num);
    }
};

dat mer(dat a, dat b){
    //printf("mer %d and %d\n",a.numfin,b.numfin);
    dat ans = dat();
    ans.totsz = a.totsz+b.totsz;
    ans.len = a.len+b.len;
    for (int x = 0; x<a.lblocknum.size(); x++){
        ans.lblocknum.push_back(a.lblocknum[x]);
        ans.lblockpos.push_back(a.lblockpos[x]);
        ans.lblockvals.push_back(a.lblockvals[x]);
        ans.lblockpsum.push_back(a.lblockpsum[x]);
        //printf("lblock %d %d %d %d\n",a.lblocknum[x],a.lblockpos[x],a.lblockvals[x],a.lblockpsum[x]);
    }
    for (int x = 0; x<b.rblocknum.size(); x++){
        ans.rblocknum.push_back(b.rblocknum[x]);
        ans.rblockpos.push_back(b.rblockpos[x]);
        ans.rblockvals.push_back(b.rblockvals[x]);
        ans.rblockpsum.push_back(b.rblockpsum[x]);
        //printf("rblock %d %d %d %d\n",b.rblocknum[x],b.rblockpos[x],b.rblockvals[x],b.rblockpsum[x]);
    }
    //printf("hi\n");
    long long t1 = a.totsz;
    int li,ri;
    bool canfin = true;
    for (int x = 0; x<b.lblocknum.size(); x++){
        if (b.lblockvals[x]<=t1){
            t1 += b.lblockpsum[x];
            if (t1>INF) t1 = INF;
        }
        else{
            li = ans.lblocknum.size();
            canfin = false;
            //assert(!ans.lblockpsum.empty());
            ans.lblockpsum.back() += t1-a.totsz;
            ans.lblockpos.push_back(b.lblockpos[x]+a.len);
            ans.lblocknum.push_back(a.numfin);
            ans.lblockvals.push_back(b.lblockvals[x]);
            ans.lblockpsum.push_back(b.totsz-(t1-a.totsz));
            break;
        }
    }
    if (canfin){
        ans.lblockpsum.back() += b.totsz;
        ans.numfin += a.numfin;
    }
    t1 = b.totsz;
    canfin = true;
    for (int x = 0; x<a.rblocknum.size(); x++){
        if (a.rblockvals[x]<=t1){
            t1 += a.rblockpsum[x];
            if (t1>INF) t1 = INF;
        }
        else{
            ri = ans.rblocknum.size();
            canfin = false;
            //assert(!ans.rblockpsum.empty());
            ans.rblockpsum.back() += t1-b.totsz;
            ans.rblockpos.push_back(a.rblockpos[x]+b.len);
            ans.rblocknum.push_back(b.numfin);
            ans.rblockvals.push_back(a.rblockvals[x]);
            ans.rblockpsum.push_back(a.totsz-(t1-b.totsz));
            break;
        }
    }
    if (canfin){
        ans.rblockpsum.back() += a.totsz;
        ans.numfin += b.numfin;
    }
    //printf("hi\n");
    t1 = 0;
    long long t2 = 0;
    int maxv = 0;
    long long sum1 = 0;
    for (int x = 0; x<a.rblocknum.size(); x++){
        sum1+= a.rblockpsum[x];
    }
    for (int x = 1; x<a.rblocknum.size(); x++){
        //printf("arblock %d %d %d %d\n",a.rblocknum[x],a.rblockpos[x],a.rblockvals[x],a.rblockpsum[x]);
        t1 += a.rblocknum[x];
        t2 += a.rblockpsum[x-1];
        sum1 -= a.rblockpsum[x-1];
        t2 = min(t2,INF);
        bool added = false;
        while (maxv<b.lblocknum.size() && b.lblockvals[maxv]<=t2){
            t2 += b.lblockpsum[maxv];
            t2 = min(t2,INF);
            maxv++;
            added = true;
        }
        if (a.rblockvals[x]>t2){
            if (maxv==b.lblocknum.size()){
                if (ans.rblockpos.back()==b.len+a.rblockpos[x]){
                    ans.rblocknum.back()+=t1;
                }
                else{
                    ans.rblockpsum.back() -= sum1;
                    ans.rblockpos.push_back(b.len+a.rblockpos[x]);
                    ans.rblocknum.push_back(t1);
                    ans.rblockvals.push_back(a.rblockvals[x]);
                    ans.rblockpsum.push_back(sum1);
                }
            }
            t1 = 0;
        }
    }
    t2 += a.rblockpsum.back();
    while (maxv<b.lblocknum.size() && b.lblockvals[maxv]<=t2){
        t2 += b.lblockpsum[maxv];
        t2 = min(t2,INF);
        maxv++;
    }
    //printf("maxv = %d\n",maxv);
    if (maxv==b.lblocknum.size()){
        ans.numfin += t1;
    }
    else{
        ans.lblocknum[li] += t1;
    }
    t1 = 0;
    t2 = 0;
    maxv = 0;
    long long sum2 = 0;
    for (int x = 0; x<b.lblocknum.size(); x++){
        sum2 += b.lblockpsum[x];
    }
    for (int x = 1; x<b.lblocknum.size(); x++){
        //printf("blblock %d %d %d %d\n",b.lblocknum[x],b.lblockpos[x],b.lblockvals[x],b.lblockpsum[x]);
        t1 += b.lblocknum[x];
        t2 += b.lblockpsum[x-1];
        sum2 -= b.lblockpsum[x-1];
        t2 = min(t2,INF);
        bool added = false;
        while (maxv<a.rblocknum.size() && a.rblockvals[maxv]<=t2){
            t2 += a.rblockpsum[maxv];
            t2 = min(t2,INF);
            maxv++;
            added = true;
        }
        if (b.lblockvals[x]>t2){
            if (maxv==a.rblocknum.size()){
                if (ans.lblockpos.back()==a.len+b.lblockpos[x]){
                    ans.lblocknum.back()+=t1;
                }
                else{
                    ans.lblockpsum.back() -= sum2;
                    ans.lblockpos.push_back(a.len+b.lblockpos[x]);
                    ans.lblocknum.push_back(t1);
                    ans.lblockvals.push_back(b.lblockvals[x]);
                    ans.lblockpsum.push_back(sum2);
                }
            }
            t1 = 0;
        }
    }
    t2 += b.lblockpsum.back();
    while (maxv<a.rblocknum.size() && a.rblockvals[maxv]<=t2){
        t2 += a.rblockpsum[maxv];
        t2 = min(t2,INF);
        maxv++;
    }
    if (maxv==a.rblocknum.size()){
        ans.numfin += t1;
    }
    else{
        ans.rblocknum[ri] += t1;
    }
    return ans;
}

int arr[100005];

struct node{
    int s,e;
    dat v;
    node *l,*r;
    node (int _s, int _e){
        s = _s;
        e = _e;
        if (s==e){
            v = dat(arr[s]);
        }
        else{
            l = new node(s,(s+e)/2);
            r = new node((s+e)/2+1,e);
            v = mer(l->v,r->v);
        //printf("node %d to %d has numfin %d\n",s,e,v.numfin);
        }
    }
    dat qu(int a, int b){
        //printf("node %d to %d, %d %d\n",s,e,a,b);
        if (a<=s && e<=b){
            return v;
        }
        if (b<=(s+e)/2){
            return l->qu(a,b);
        }
        if (a>(s+e)/2){
            return r->qu(a,b);
        }
        //printf("end %d %d\n",s,e);
        return mer(l->qu(a,b),r->qu(a,b));
    }
    void upd(int pos){
        if (s==e){
            v = dat(arr[s]);
            return;
        }
        if (pos<=(s+e)/2){
            l->upd(pos);
        }
        else{
            r->upd(pos);
        }
        v = mer(l->v,r->v);
    }
}*root;

 main(){
    int n;
    scanf("%d",&n);
    for (int x = 1; x<=n; x++){
        scanf("%d",&arr[x]);
    }
    root = new node(1,n);
    int q;
    scanf("%d",&q);
    while (q--){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        if (a==1){
            arr[b] = c;
            root->upd(b);
        }
        else{
            printf("%d\n",root->qu(b,c).numfin);
        }
    }
}

Compilation message

fish2.cpp: In function 'dat mer(dat, dat)':
fish2.cpp:43:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |     for (int x = 0; x<a.lblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:50:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     for (int x = 0; x<b.rblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:61:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |     for (int x = 0; x<b.lblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:84:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   84 |     for (int x = 0; x<a.rblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:110:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  110 |     for (int x = 0; x<a.rblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:113:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  113 |     for (int x = 1; x<a.rblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:120:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  120 |         while (maxv<b.lblocknum.size() && b.lblockvals[maxv]<=t2){
      |                ~~~~^~~~~~~~~~~~~~~~~~~
fish2.cpp:127:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  127 |             if (maxv==b.lblocknum.size()){
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~
fish2.cpp:119:14: warning: variable 'added' set but not used [-Wunused-but-set-variable]
  119 |         bool added = false;
      |              ^~~~~
fish2.cpp:143:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  143 |     while (maxv<b.lblocknum.size() && b.lblockvals[maxv]<=t2){
      |            ~~~~^~~~~~~~~~~~~~~~~~~
fish2.cpp:149:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  149 |     if (maxv==b.lblocknum.size()){
      |         ~~~~^~~~~~~~~~~~~~~~~~~~
fish2.cpp:159:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  159 |     for (int x = 0; x<b.lblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:162:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  162 |     for (int x = 1; x<b.lblocknum.size(); x++){
      |                     ~^~~~~~~~~~~~~~~~~~~
fish2.cpp:169:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  169 |         while (maxv<a.rblocknum.size() && a.rblockvals[maxv]<=t2){
      |                ~~~~^~~~~~~~~~~~~~~~~~~
fish2.cpp:176:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  176 |             if (maxv==a.rblocknum.size()){
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~
fish2.cpp:168:14: warning: variable 'added' set but not used [-Wunused-but-set-variable]
  168 |         bool added = false;
      |              ^~~~~
fish2.cpp:192:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  192 |     while (maxv<a.rblocknum.size() && a.rblockvals[maxv]<=t2){
      |            ~~~~^~~~~~~~~~~~~~~~~~~
fish2.cpp:197:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  197 |     if (maxv==a.rblocknum.size()){
      |         ~~~~^~~~~~~~~~~~~~~~~~~~
fish2.cpp: At global scope:
fish2.cpp:254:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  254 |  main(){
      |  ^~~~
fish2.cpp: In function 'int main()':
fish2.cpp:256:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  256 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
fish2.cpp:258:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  258 |         scanf("%d",&arr[x]);
      |         ~~~~~^~~~~~~~~~~~~~
fish2.cpp:262:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  262 |     scanf("%d",&q);
      |     ~~~~~^~~~~~~~~
fish2.cpp:265:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  265 |         scanf("%d%d%d",&a,&b,&c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
fish2.cpp: In function 'dat mer(dat, dat)':
fish2.cpp:201:25: warning: 'ri' may be used uninitialized in this function [-Wmaybe-uninitialized]
  201 |         ans.rblocknum[ri] += t1;
      |                         ^
fish2.cpp:153:25: warning: 'li' may be used uninitialized in this function [-Wmaybe-uninitialized]
  153 |         ans.lblocknum[li] += t1;
      |                         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 10 ms 852 KB Output is correct
6 Correct 8 ms 844 KB Output is correct
7 Correct 8 ms 840 KB Output is correct
8 Correct 6 ms 724 KB Output is correct
9 Correct 7 ms 724 KB Output is correct
10 Correct 5 ms 724 KB Output is correct
11 Correct 4 ms 724 KB Output is correct
12 Correct 8 ms 724 KB Output is correct
13 Correct 6 ms 724 KB Output is correct
14 Correct 8 ms 724 KB Output is correct
15 Correct 7 ms 724 KB Output is correct
16 Correct 7 ms 724 KB Output is correct
17 Correct 6 ms 724 KB Output is correct
18 Correct 5 ms 724 KB Output is correct
19 Correct 5 ms 724 KB Output is correct
20 Correct 7 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 197 ms 107152 KB Output is correct
3 Correct 221 ms 105136 KB Output is correct
4 Correct 186 ms 106956 KB Output is correct
5 Correct 190 ms 105324 KB Output is correct
6 Correct 196 ms 101036 KB Output is correct
7 Correct 166 ms 101200 KB Output is correct
8 Correct 171 ms 100968 KB Output is correct
9 Correct 182 ms 101108 KB Output is correct
10 Correct 234 ms 107732 KB Output is correct
11 Correct 188 ms 104132 KB Output is correct
12 Correct 231 ms 101004 KB Output is correct
13 Correct 164 ms 101012 KB Output is correct
14 Correct 177 ms 101228 KB Output is correct
15 Correct 188 ms 101412 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 10 ms 852 KB Output is correct
6 Correct 8 ms 844 KB Output is correct
7 Correct 8 ms 840 KB Output is correct
8 Correct 6 ms 724 KB Output is correct
9 Correct 7 ms 724 KB Output is correct
10 Correct 5 ms 724 KB Output is correct
11 Correct 4 ms 724 KB Output is correct
12 Correct 8 ms 724 KB Output is correct
13 Correct 6 ms 724 KB Output is correct
14 Correct 8 ms 724 KB Output is correct
15 Correct 7 ms 724 KB Output is correct
16 Correct 7 ms 724 KB Output is correct
17 Correct 6 ms 724 KB Output is correct
18 Correct 5 ms 724 KB Output is correct
19 Correct 5 ms 724 KB Output is correct
20 Correct 7 ms 724 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 197 ms 107152 KB Output is correct
23 Correct 221 ms 105136 KB Output is correct
24 Correct 186 ms 106956 KB Output is correct
25 Correct 190 ms 105324 KB Output is correct
26 Correct 196 ms 101036 KB Output is correct
27 Correct 166 ms 101200 KB Output is correct
28 Correct 171 ms 100968 KB Output is correct
29 Correct 182 ms 101108 KB Output is correct
30 Correct 234 ms 107732 KB Output is correct
31 Correct 188 ms 104132 KB Output is correct
32 Correct 231 ms 101004 KB Output is correct
33 Correct 164 ms 101012 KB Output is correct
34 Correct 177 ms 101228 KB Output is correct
35 Correct 188 ms 101412 KB Output is correct
36 Correct 221 ms 107160 KB Output is correct
37 Correct 206 ms 105284 KB Output is correct
38 Correct 240 ms 105224 KB Output is correct
39 Correct 280 ms 107108 KB Output is correct
40 Correct 205 ms 105116 KB Output is correct
41 Correct 186 ms 101184 KB Output is correct
42 Correct 198 ms 101068 KB Output is correct
43 Correct 201 ms 101296 KB Output is correct
44 Correct 197 ms 101240 KB Output is correct
45 Correct 238 ms 107852 KB Output is correct
46 Correct 222 ms 107868 KB Output is correct
47 Correct 208 ms 103836 KB Output is correct
48 Correct 212 ms 101052 KB Output is correct
49 Correct 184 ms 101060 KB Output is correct
50 Correct 204 ms 101184 KB Output is correct
51 Correct 228 ms 101428 KB Output is correct
52 Correct 201 ms 101196 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 197 ms 107152 KB Output is correct
3 Correct 221 ms 105136 KB Output is correct
4 Correct 186 ms 106956 KB Output is correct
5 Correct 190 ms 105324 KB Output is correct
6 Correct 196 ms 101036 KB Output is correct
7 Correct 166 ms 101200 KB Output is correct
8 Correct 171 ms 100968 KB Output is correct
9 Correct 182 ms 101108 KB Output is correct
10 Correct 234 ms 107732 KB Output is correct
11 Correct 188 ms 104132 KB Output is correct
12 Correct 231 ms 101004 KB Output is correct
13 Correct 164 ms 101012 KB Output is correct
14 Correct 177 ms 101228 KB Output is correct
15 Correct 188 ms 101412 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 2691 ms 105904 KB Output is correct
18 Correct 2443 ms 107872 KB Output is correct
19 Correct 2606 ms 105796 KB Output is correct
20 Correct 2740 ms 105528 KB Output is correct
21 Correct 2666 ms 105584 KB Output is correct
22 Correct 2510 ms 107512 KB Output is correct
23 Correct 2570 ms 105644 KB Output is correct
24 Correct 2777 ms 105580 KB Output is correct
25 Correct 2763 ms 105604 KB Output is correct
26 Correct 2758 ms 105792 KB Output is correct
27 Correct 1517 ms 101644 KB Output is correct
28 Correct 1535 ms 101640 KB Output is correct
29 Correct 1544 ms 101684 KB Output is correct
30 Correct 2075 ms 101424 KB Output is correct
31 Correct 2159 ms 101620 KB Output is correct
32 Correct 2849 ms 104284 KB Output is correct
33 Correct 2769 ms 108448 KB Output is correct
34 Correct 2855 ms 104336 KB Output is correct
35 Correct 2529 ms 103948 KB Output is correct
36 Correct 2990 ms 108640 KB Output is correct
37 Correct 1560 ms 101368 KB Output is correct
38 Correct 1365 ms 101208 KB Output is correct
39 Correct 1812 ms 101864 KB Output is correct
40 Correct 1964 ms 102304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 197 ms 107152 KB Output is correct
3 Correct 221 ms 105136 KB Output is correct
4 Correct 186 ms 106956 KB Output is correct
5 Correct 190 ms 105324 KB Output is correct
6 Correct 196 ms 101036 KB Output is correct
7 Correct 166 ms 101200 KB Output is correct
8 Correct 171 ms 100968 KB Output is correct
9 Correct 182 ms 101108 KB Output is correct
10 Correct 234 ms 107732 KB Output is correct
11 Correct 188 ms 104132 KB Output is correct
12 Correct 231 ms 101004 KB Output is correct
13 Correct 164 ms 101012 KB Output is correct
14 Correct 177 ms 101228 KB Output is correct
15 Correct 188 ms 101412 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 3420 ms 107348 KB Output is correct
18 Correct 3237 ms 105624 KB Output is correct
19 Correct 2663 ms 105520 KB Output is correct
20 Correct 2573 ms 105700 KB Output is correct
21 Correct 3217 ms 107208 KB Output is correct
22 Correct 3116 ms 105512 KB Output is correct
23 Correct 2667 ms 105452 KB Output is correct
24 Correct 2787 ms 105828 KB Output is correct
25 Correct 2356 ms 105284 KB Output is correct
26 Correct 1729 ms 101412 KB Output is correct
27 Correct 2507 ms 101216 KB Output is correct
28 Correct 1942 ms 102344 KB Output is correct
29 Correct 1994 ms 101572 KB Output is correct
30 Correct 2527 ms 101112 KB Output is correct
31 Correct 2612 ms 102248 KB Output is correct
32 Correct 2986 ms 104404 KB Output is correct
33 Correct 2098 ms 103996 KB Output is correct
34 Correct 2643 ms 108092 KB Output is correct
35 Correct 1918 ms 108276 KB Output is correct
36 Correct 2504 ms 104192 KB Output is correct
37 Correct 2318 ms 102760 KB Output is correct
38 Correct 1364 ms 102756 KB Output is correct
39 Correct 1898 ms 101812 KB Output is correct
40 Correct 757 ms 101892 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 10 ms 852 KB Output is correct
6 Correct 8 ms 844 KB Output is correct
7 Correct 8 ms 840 KB Output is correct
8 Correct 6 ms 724 KB Output is correct
9 Correct 7 ms 724 KB Output is correct
10 Correct 5 ms 724 KB Output is correct
11 Correct 4 ms 724 KB Output is correct
12 Correct 8 ms 724 KB Output is correct
13 Correct 6 ms 724 KB Output is correct
14 Correct 8 ms 724 KB Output is correct
15 Correct 7 ms 724 KB Output is correct
16 Correct 7 ms 724 KB Output is correct
17 Correct 6 ms 724 KB Output is correct
18 Correct 5 ms 724 KB Output is correct
19 Correct 5 ms 724 KB Output is correct
20 Correct 7 ms 724 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 197 ms 107152 KB Output is correct
23 Correct 221 ms 105136 KB Output is correct
24 Correct 186 ms 106956 KB Output is correct
25 Correct 190 ms 105324 KB Output is correct
26 Correct 196 ms 101036 KB Output is correct
27 Correct 166 ms 101200 KB Output is correct
28 Correct 171 ms 100968 KB Output is correct
29 Correct 182 ms 101108 KB Output is correct
30 Correct 234 ms 107732 KB Output is correct
31 Correct 188 ms 104132 KB Output is correct
32 Correct 231 ms 101004 KB Output is correct
33 Correct 164 ms 101012 KB Output is correct
34 Correct 177 ms 101228 KB Output is correct
35 Correct 188 ms 101412 KB Output is correct
36 Correct 221 ms 107160 KB Output is correct
37 Correct 206 ms 105284 KB Output is correct
38 Correct 240 ms 105224 KB Output is correct
39 Correct 280 ms 107108 KB Output is correct
40 Correct 205 ms 105116 KB Output is correct
41 Correct 186 ms 101184 KB Output is correct
42 Correct 198 ms 101068 KB Output is correct
43 Correct 201 ms 101296 KB Output is correct
44 Correct 197 ms 101240 KB Output is correct
45 Correct 238 ms 107852 KB Output is correct
46 Correct 222 ms 107868 KB Output is correct
47 Correct 208 ms 103836 KB Output is correct
48 Correct 212 ms 101052 KB Output is correct
49 Correct 184 ms 101060 KB Output is correct
50 Correct 204 ms 101184 KB Output is correct
51 Correct 228 ms 101428 KB Output is correct
52 Correct 201 ms 101196 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 2691 ms 105904 KB Output is correct
55 Correct 2443 ms 107872 KB Output is correct
56 Correct 2606 ms 105796 KB Output is correct
57 Correct 2740 ms 105528 KB Output is correct
58 Correct 2666 ms 105584 KB Output is correct
59 Correct 2510 ms 107512 KB Output is correct
60 Correct 2570 ms 105644 KB Output is correct
61 Correct 2777 ms 105580 KB Output is correct
62 Correct 2763 ms 105604 KB Output is correct
63 Correct 2758 ms 105792 KB Output is correct
64 Correct 1517 ms 101644 KB Output is correct
65 Correct 1535 ms 101640 KB Output is correct
66 Correct 1544 ms 101684 KB Output is correct
67 Correct 2075 ms 101424 KB Output is correct
68 Correct 2159 ms 101620 KB Output is correct
69 Correct 2849 ms 104284 KB Output is correct
70 Correct 2769 ms 108448 KB Output is correct
71 Correct 2855 ms 104336 KB Output is correct
72 Correct 2529 ms 103948 KB Output is correct
73 Correct 2990 ms 108640 KB Output is correct
74 Correct 1560 ms 101368 KB Output is correct
75 Correct 1365 ms 101208 KB Output is correct
76 Correct 1812 ms 101864 KB Output is correct
77 Correct 1964 ms 102304 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 3420 ms 107348 KB Output is correct
80 Correct 3237 ms 105624 KB Output is correct
81 Correct 2663 ms 105520 KB Output is correct
82 Correct 2573 ms 105700 KB Output is correct
83 Correct 3217 ms 107208 KB Output is correct
84 Correct 3116 ms 105512 KB Output is correct
85 Correct 2667 ms 105452 KB Output is correct
86 Correct 2787 ms 105828 KB Output is correct
87 Correct 2356 ms 105284 KB Output is correct
88 Correct 1729 ms 101412 KB Output is correct
89 Correct 2507 ms 101216 KB Output is correct
90 Correct 1942 ms 102344 KB Output is correct
91 Correct 1994 ms 101572 KB Output is correct
92 Correct 2527 ms 101112 KB Output is correct
93 Correct 2612 ms 102248 KB Output is correct
94 Correct 2986 ms 104404 KB Output is correct
95 Correct 2098 ms 103996 KB Output is correct
96 Correct 2643 ms 108092 KB Output is correct
97 Correct 1918 ms 108276 KB Output is correct
98 Correct 2504 ms 104192 KB Output is correct
99 Correct 2318 ms 102760 KB Output is correct
100 Correct 1364 ms 102756 KB Output is correct
101 Correct 1898 ms 101812 KB Output is correct
102 Correct 757 ms 101892 KB Output is correct
103 Correct 3519 ms 105572 KB Output is correct
104 Correct 3207 ms 107408 KB Output is correct
105 Correct 2582 ms 105748 KB Output is correct
106 Correct 2392 ms 105800 KB Output is correct
107 Correct 3102 ms 105688 KB Output is correct
108 Correct 3256 ms 107420 KB Output is correct
109 Correct 2718 ms 105572 KB Output is correct
110 Correct 2609 ms 105860 KB Output is correct
111 Correct 2650 ms 105772 KB Output is correct
112 Correct 2447 ms 105688 KB Output is correct
113 Correct 2362 ms 101256 KB Output is correct
114 Correct 1667 ms 101628 KB Output is correct
115 Correct 2908 ms 102320 KB Output is correct
116 Correct 2479 ms 102444 KB Output is correct
117 Correct 1731 ms 101528 KB Output is correct
118 Correct 2265 ms 102312 KB Output is correct
119 Correct 2712 ms 101468 KB Output is correct
120 Correct 2872 ms 102688 KB Output is correct
121 Correct 2424 ms 102644 KB Output is correct
122 Correct 3207 ms 104444 KB Output is correct
123 Correct 2659 ms 104416 KB Output is correct
124 Correct 2498 ms 104164 KB Output is correct
125 Correct 2419 ms 103864 KB Output is correct
126 Correct 2522 ms 104272 KB Output is correct
127 Correct 2955 ms 102780 KB Output is correct
128 Correct 1884 ms 102092 KB Output is correct
129 Correct 2551 ms 101956 KB Output is correct
130 Correct 2123 ms 102188 KB Output is correct