제출 #824230

#제출 시각아이디문제언어결과실행 시간메모리
824230Liudas송신탑 (IOI22_towers)C++17
컴파일 에러
0 ms0 KiB
#include "towers.h" #include <cassert> #include <cstdio> #include <bits/stdc++.h> using namespace std; vector<int> h; void init(int N, vector<int> H){ h = H; } int max_towers(int L, int R, int D){ int score = 0; for(int i = L; i <= R; i ++){ int H = h[i]; int s = 0; bool good = false; for(int j = L; j <= R; j ++){ if(!good && h[j] + D <= H){ s ++; good = true; } else if(good && h[j] >= H){ good = false; } } score = max(score, s); } return max(1, score); } int main() { int N, Q; ios_base::sync_with_stdio(0); cin.tie(0); assert(2 == scanf("%d %d", &N, &Q)); std::vector<int> H(N); for (int i = 0; i < N; ++i) { assert(1 == scanf("%d", &H[i])); } init(N, H); for (int i = 0; i < Q; ++i) { int L, R, D; assert(3 == scanf("%d %d %d", &L, &R, &D)); cout << max_towers(L, R, D) << "\n"; } return 0; }

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

/usr/bin/ld: /tmp/cckFdXNP.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccWLVRiQ.o:towers.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status