QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#295854#1418. Mountain Rescue Team170 1ms3680kbC++201.2kb2024-01-01 12:55:392024-01-01 12:55:39

Judging History

你现在查看的是最新测评结果

  • [2024-01-01 12:55:39]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3680kb
  • [2024-01-01 12:55:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#include "grader.h"
void Rescue(int R, int C, int MR, int MC, int X){
Pinpoint(1, 1);
return;
  if(R*C <= 1000){
    for(int i = 1; i <= R; i++){
      for(int j = 1; j <= C; j++){
        if(Measure(i, j) == X){
          Pinpoint(i, j);
          return;
        }
      }
    }
  }
  int l = 0, r = max(MR, R-MR+1) + max(MC, C-MC+1) - 2;
  while(r-l > 1){
    int mid = (l+r)/2;
    int x = MR, y = MC;
    int d = mid;
    if(MR < R-MR+1){
      x += min(R-MR, d);
      d -= min(R-MR, d);
    }else{
      x -= min(MR-1, d);
      d -= min(MR-1, d);
    }
    if(MC < C-MC+1){
      y += min(C-MC, d);
      d -= min(C-MC, d);
    }else{
      y -= min(MC-1, d);
      d -= min(MC-1, d);
    }
    int h = Measure(x, y);
    if(h == X){
      Pinpoint(x, y);
      return;
    }
    if(h < X) r = mid;
    else l = mid;
  }
  for(int i = 1; i <= R; i++){
    for(int j = 1; j <= C; j++){
      int k = abs(i-MR)+abs(j-MC);
      if(k == l || k == r){
        int h = Measure(i, j);
        if(h == X){
          Pinpoint(i, j);
          return;
        }
      }
    }
  }
}

详细

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 20
Accepted
time: 1ms
memory: 3632kb

input:

1 1 1 1 1
1

output:

Accepted

Test #2:

score: 0
Accepted
time: 1ms
memory: 3680kb

input:

2 2 2 2 1
1 2
3 4

output:

Accepted

Test #3:

score: -20
Runtime Error

input:

2 2 2 2 2
1 2
3 4

output:

Wrong Answer [4]

Subtask #2:

score: 0
Skipped

Dependency #1:

0%