Submission #595499

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5954992022-07-13 19:14:44Aldas25Square or Rectangle? (NOI19_squarerect)C++14
100 / 100
1 ms296 KiB
#include "squarerect.h"
#include <bits/stdc++.h>
using namespace std;
int N;
bool my_inside_shape(int X, int Y) {
if (X <= 0 || X > N || Y <= 0 || Y > N) return false;
else return inside_shape(X, Y);
}
bool am_i_square(int _N, int Q) {
N = _N;
bool stratified[5][5];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
stratified[i][j] = inside_shape((i+1)*20, (j+1)*20);
}
}
bool found = 0;
for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) found = max(found, stratified[i][j]);
if (!found) {
for (int i = 0; i < 5; i++) stratified[i][4] = my_inside_shape((i+1)*20, 100);
for (int i = 0; i < 4; i++) stratified[4][i] = my_inside_shape(100, (i+1)*20);
for (int i = 0; i < 5; i++) for (int j = 0; j < 5; j++) found = max(found, stratified[i][j]);
if (!found) return false;
vector< pair<int, int> > founds;
for (int i = 0; i < 5; i++) for (int j = 0; j < 5; j++) if (stratified[i][j]) founds.push_back(make_pair(i, j));
if (founds.size() > 1) return false;
int x = founds[0].first, y = founds[0].second;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...