답안 #1028718

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1028718 2024-07-20T07:34:34 Z DeltaStruct 산악 구조대 (JOI13_mountain) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#include "mountain.h"/*
vector<vector<int>> high; vector<pair<int,int>> ans;
int Measure(int RM,int CM){ return high[RM-1][CM-1]; }
void Pinpoint(int RP,int CP){ ans.emplace_back(RP,CP); }
void Rescue(int R,int C,int MR,int MC,int X);
int main(){
  int q; cin >> q; while(q--){
    int R,C,MR,MC,X; cin >> R >> C >> MR >> MC >> X;
    high.resize(R);
    for (auto& a:high){
      a.resize(C); for (int& b:a) cin >> b;
    }
    Rescue(R,C,MR,MC,X);
  }
  for (auto [a,b]:ans) cout << a << ' ' << b << endl;
}
//*/

void Rescue(int R,int C,int MR,int MC,int X){
  --MR;
  int x = 0,y = MC-1;
  while(x!=MR+1&&y!=-1){
    int r = Measure(x+1,y+1);
    if (r==X){
      Pinpoint(x+1,y+1);
      return;
    }
    if (r<X) ++x;
    else --y;
  }
  x = 0,y = MC-1;
  while(x!=MR+1&&y!=C){
    int r = Measure(x+1,y+1);
    if (r==X){
      Pinpoint(x+1,y+1);
      return;
    }
    if (r<X) ++x;
    else ++y;
  }
  x = R-1,y = MC-1;
  while(x!=MR+1&&y!=-1){
    int r = Measure(x+1,y+1);
    if (r==X){
      Pinpoint(x+1,y+1);
      return;
    }
    if (r<X) --x;
    else --y;
  }
  x = R-1,y = MC-1;
  while(x!=MR-1&&y!=C){
    int r = Measure(x+1,y+1);
    if (r==X){
      Pinpoint(x+1,y+1);
      return;
    }
    if (r<X) --x;
    else ++y;
  }
}

Compilation message

mountain.cpp:3:10: fatal error: mountain.h: No such file or directory
    3 | #include "mountain.h"/*
      |          ^~~~~~~~~~~~
compilation terminated.