답안 #614951

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
614951 2022-07-31T05:41:26 Z 반딧불(#8492) Broken Device 2 (JOI22_device2) C++17
10 / 100
844 ms 109164 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

namespace {
    int variable_example = 0;
    int Zero[5000002], One[5000002], rescnt;
}

int Declare() {
    for(int i=1; i<=2000; i++){
        for(int j=0; j<=i+i; j++){
            ++rescnt;
            Zero[rescnt] = j, One[rescnt] = i+i-j;
        }
    }

    return 2000;
}

pair<vector<int>, vector<int> > Anna(ll X){
    vector<int> A, B;
    int len = (Zero[X] + One[X]) / 2;
    A.resize(len), B.resize(len);
    if(One[X] <= len) for(int i=0; i<One[X]; i++) A[i] = 1;
    else{
        for(int i=0; i<len; i++) A[i] = 1;
        for(int j=0; j<One[X]-len; j++) B[j] = 1;
    }
    return make_pair(A, B);
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

namespace {
    bool initialized = 0;
    int result[4002][4002], rescnt;
    int variable_example = 0;

}

void init(){
    for(int i=1; i<=2000; i++){
        for(int j=0; j<=i+i; j++){
            result[j][i+i-j] = ++rescnt;
        }
    }
    initialized = 1;
}

ll Bruno(vector<int> u){
    if(!initialized) init();
    return result[count(u.begin(), u.end(), 0)][count(u.begin(), u.end(), 1)];
}

Compilation message

Anna.cpp:9:9: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 |     int variable_example = 0;
      |         ^~~~~~~~~~~~~~~~

Bruno.cpp:11:9: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   11 |     int variable_example = 0;
      |         ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 82 ms 77100 KB Output is correct
2 Correct 83 ms 77428 KB Output is correct
3 Correct 96 ms 77952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 82 ms 77100 KB Output is correct
2 Correct 83 ms 77428 KB Output is correct
3 Correct 96 ms 77952 KB Output is correct
4 Correct 593 ms 98644 KB Output is correct
5 Correct 771 ms 98424 KB Output is correct
6 Correct 629 ms 98928 KB Output is correct
7 Correct 603 ms 98348 KB Output is correct
8 Correct 689 ms 98768 KB Output is correct
9 Correct 844 ms 109076 KB Output is correct
10 Correct 844 ms 109164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 82 ms 77100 KB Output is correct
2 Correct 83 ms 77428 KB Output is correct
3 Correct 96 ms 77952 KB Output is correct
4 Correct 593 ms 98644 KB Output is correct
5 Correct 771 ms 98424 KB Output is correct
6 Correct 629 ms 98928 KB Output is correct
7 Correct 603 ms 98348 KB Output is correct
8 Correct 689 ms 98768 KB Output is correct
9 Correct 844 ms 109076 KB Output is correct
10 Correct 844 ms 109164 KB Output is correct
11 Runtime error 41 ms 63948 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 82 ms 77100 KB Output is correct
2 Correct 83 ms 77428 KB Output is correct
3 Correct 96 ms 77952 KB Output is correct
4 Correct 593 ms 98644 KB Output is correct
5 Correct 771 ms 98424 KB Output is correct
6 Correct 629 ms 98928 KB Output is correct
7 Correct 603 ms 98348 KB Output is correct
8 Correct 689 ms 98768 KB Output is correct
9 Correct 844 ms 109076 KB Output is correct
10 Correct 844 ms 109164 KB Output is correct
11 Runtime error 41 ms 63948 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 82 ms 77100 KB Output is correct
2 Correct 83 ms 77428 KB Output is correct
3 Correct 96 ms 77952 KB Output is correct
4 Correct 593 ms 98644 KB Output is correct
5 Correct 771 ms 98424 KB Output is correct
6 Correct 629 ms 98928 KB Output is correct
7 Correct 603 ms 98348 KB Output is correct
8 Correct 689 ms 98768 KB Output is correct
9 Correct 844 ms 109076 KB Output is correct
10 Correct 844 ms 109164 KB Output is correct
11 Runtime error 41 ms 63948 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 43 ms 63956 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -