답안 #833658

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
833658 2023-08-22T07:33:54 Z Trumling 송신탑 (IOI22_towers) C++17
0 / 100
438 ms 1612 KB
#include "towers.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define pb push_back
#define INF 9999999999999999
ll k=0,n;
vector<int>h;
void init(int N, vector<int> H) 
{
  n=N;
  for(int i=0;i<N;i++)
  {
    h.pb(H[i]);

    if(i!=0)
    {
      if(H[i-1]<H[i] && H[i+1]<H[i])
      k==i;
    }
  }
    

}

int max_towers(int L, int R, int D) {

  if(L>=k || R<k)
  return 1;

  if(h[k]-D<h[L] || h[k]-D<h[R])
  return 1;
  else
  return 2;
}

Compilation message

towers.cpp: In function 'void init(int, std::vector<int>)':
towers.cpp:24:8: warning: statement has no effect [-Wunused-value]
   24 |       k==i;
      |       ~^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 266 ms 1104 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 438 ms 1612 KB 1st lines differ - on the 1st token, expected: '11903', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 197 ms 592 KB 1st lines differ - on the 1st token, expected: '7197', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 266 ms 1104 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -