제출 #1221061

#제출 시각아이디문제언어결과실행 시간메모리
1221061SpyrosAlivHack (APIO25_hack)C++20
컴파일 에러
0 ms0 KiB
#include "hack.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long

const int MX = 1e6;

int hack() {
    vector<ll> willAsk;
    for (int i = 1; i <= MX; i++) willAsk.push_back(i);
    ll tot = collisions(willAsk);
    for (int i = 1; i <= MX; i++) {
        ll range = MX / i - 1;
        ll willDo = i * range * (range + 1) / 2 + (range + 1) * (x % n);
        if (willDo == tot) return i;
    }
    assert(false);
}

컴파일 시 표준 에러 (stderr) 메시지

hack.cpp: In function 'int hack()':
hack.cpp:14:66: error: 'x' was not declared in this scope
   14 |         ll willDo = i * range * (range + 1) / 2 + (range + 1) * (x % n);
      |                                                                  ^
hack.cpp:14:70: error: 'n' was not declared in this scope
   14 |         ll willDo = i * range * (range + 1) / 2 + (range + 1) * (x % n);
      |                                                                      ^