답안 #637772

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
637772 2022-09-03T07:58:36 Z victor_gao Broken Device 2 (JOI22_device2) C++17
5 / 100
651 ms 524288 KB
#include "Anna.h"
#include <utility>
#include <vector>

namespace {

int variable_example = 0;

}

int Declare() {
  return 2000;
}

std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
  std::vector<int> X = {};
  std::vector<int> Y = {};
  int val=A/2000,last=A%2000;
  while (val){
    X.push_back(1);
    if (val==1) break;
    Y.push_back(1);
    val-=2;
  }
  while (last){
    Y.push_back(0);
    if (last==1) break;
    X.push_back(0);
    last-=2;
  }
  if ((X.size()+Y.size())%2){
    if (X.size()>Y.size()) Y.push_back(1);
    else X.push_back(1);
    X.push_back(1);
    Y.push_back(1);
  }
  return make_pair(X, Y);
}
#include "Bruno.h"
#include <utility>
#include <vector>

namespace {

int variable_example = 0;

}

long long Bruno(std::vector<int> u) {
  long long ans1=0,ans0=0;
  for (auto i:u){
    if (i==1) ans1++;
    else ans0++;
  }
  if (u.back()==1) return (ans1-3)*2000+ans0;
  else return ans1*2000+ans0;
}

Compilation message

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

Bruno.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 91 ms 4932 KB Output is correct
3 Correct 263 ms 12648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 91 ms 4932 KB Output is correct
3 Correct 263 ms 12648 KB Output is correct
4 Correct 367 ms 16684 KB Output is correct
5 Correct 356 ms 16584 KB Output is correct
6 Correct 365 ms 17064 KB Output is correct
7 Correct 373 ms 16676 KB Output is correct
8 Incorrect 364 ms 16908 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 91 ms 4932 KB Output is correct
3 Correct 263 ms 12648 KB Output is correct
4 Correct 367 ms 16684 KB Output is correct
5 Correct 356 ms 16584 KB Output is correct
6 Correct 365 ms 17064 KB Output is correct
7 Correct 373 ms 16676 KB Output is correct
8 Incorrect 364 ms 16908 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 91 ms 4932 KB Output is correct
3 Correct 263 ms 12648 KB Output is correct
4 Correct 367 ms 16684 KB Output is correct
5 Correct 356 ms 16584 KB Output is correct
6 Correct 365 ms 17064 KB Output is correct
7 Correct 373 ms 16676 KB Output is correct
8 Incorrect 364 ms 16908 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 516 KB Output is correct
2 Correct 91 ms 4932 KB Output is correct
3 Correct 263 ms 12648 KB Output is correct
4 Correct 367 ms 16684 KB Output is correct
5 Correct 356 ms 16584 KB Output is correct
6 Correct 365 ms 17064 KB Output is correct
7 Correct 373 ms 16676 KB Output is correct
8 Incorrect 364 ms 16908 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 651 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -