Submission #1164867

#TimeUsernameProblemLanguageResultExecution timeMemory
1164867nuutsnoynton산악 구조대 (JOI13_mountain)C++20
100 / 100
6 ms580 KiB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
using ll = long long;
const int mod = 998244353;


void Rescue(int R, int C, int MR, int MC, int X){
	int x, y, s;
	x = MR;
	y = 1;
	while ( y < MC ) {
		while (x >= 1) {
			s =  Measure(x, y);
			if ( s > X) x --;
			else {
				if (s == X) {
					Pinpoint(x, y);
				}
				else break;
			}
		}
		y ++;
	}
	x = MR;
	y = C;
	while ( y >= MC ) {
		while (x >= 1) {
			s =  Measure(x, y);
			if ( s > X) x --;
			else {
				if (s == X) {
					Pinpoint(x, y);
				}
				else break;
			}
		}
		y --;
	}
	x = MR;
	y = 1;
	while ( y < MC ) {
		while (x <= R) {
			s =  Measure(x, y);
			if ( s > X) x ++;
			else {
				if (s == X) {
					Pinpoint(x, y);
				}
				else break;
			}
		}
		y ++;
	}
	x = MR;
	y = C;
	while ( y >= MC ) {
		while (x <= R) {
			s =  Measure(x, y);
			if ( s > X) x ++;
			else {
				if (s == X) {
					Pinpoint(x, y);
				}
				else break;
			}
		}
		y --;
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...