답안 #1099790

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1099790 2024-10-12T05:18:23 Z model_code 메시지 (IOI24_message) C++17
0 / 100
141 ms 816 KB
// runtime_error/misbehaving1.cpp

#include "message.h"

#include <bits/stdc++.h>

using namespace std;

vector<vector<bool>> msgs;

int ind=0;

// Trying to use global variables to save message, doesn't fail when shuffling but fails with different instances.

void send_message(
    std::vector<bool> message, std::vector<bool> positions) {
  msgs.push_back(message);
  for(int i=0;i<10;i++) {
    vector<bool> cur(31, (ind>>i)&1);
    send_packet(cur);
  }
}

std::vector<bool> receive_message(
    std::vector<std::vector<bool>> received_bits) {
  int ind=0;
  for (int i=0;i<received_bits.size();i++) {
    auto round=received_bits[i];
    std::sort(round.begin(), round.end());
    ind |=round[15];
  }
  return msgs[ind];
}

Compilation message

message.cpp: In function 'std::vector<bool> receive_message(std::vector<std::vector<bool> >)':
message.cpp:27:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |   for (int i=0;i<received_bits.size();i++) {
      |                ~^~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 332 KB Possible tampering with sol2mgr[1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 141 ms 816 KB Possible tampering with sol2mgr[1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 332 KB Possible tampering with sol2mgr[1]
2 Halted 0 ms 0 KB -