Submission #1280391

#TimeUsernameProblemLanguageResultExecution timeMemory
1280391jackofall718Square or Rectangle? (NOI19_squarerect)C++20
0 / 100
1 ms340 KiB
#include <bits/stdc++.h>
using namespace std;

extern bool inside_shape(int X, int Y); 

bool am_i_square(int n, int Q) {        // must use int, not long long
    int start_x = -1;
    int start_y = -1;
    bool found = false;

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (inside_shape(i, j)) {
                found = true;
                start_x = i;
                start_y = j;
                break;
            }
        }
        if (found) break;
    }

    bool check = true;
    while (start_x <= n && start_y <= n) {
        if (inside_shape(start_x + 1, start_y + 1)) {
            start_x++;
            start_y++;
        } else {
            check = false;
            break;
        }
    }

    return check;
}

    
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...