Submission #1034005

# Submission time Handle Problem Language Result Execution time Memory
1034005 2024-07-25T08:37:28 Z 김은성(#10970) Tiles (BOI24_tiles) C++17
0 / 100
31 ms 5048 KB
#define x first
#define y second
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n, xm, i, j, x, y;
    scanf("%d %d", &n, &xm);
    vector<pair<int, int> > p;
    for(i=1; i<n; i++){
        scanf("%d %d", &x, &y);
        while(p.size() >= 2 && ((p[p.size()-2].x == p[p.size()-1].x && p.back().x==x) ||
              (p[p.size()-2].y == p[p.size()-1].y && p.back().y==y)))
            p.pop_back();
        p.push_back(make_pair(x, y));
    }
    int opt = 0;
    for(i=0; i<p.size(); i++){
        if(p[i].x%2==0 && p[i].y%2==0)
            opt= i;
        else
            break;
    }
    printf("%d\n", opt);
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for(i=0; i<p.size(); i++){
      |              ~^~~~~~~~~
Main.cpp:6:19: warning: unused variable 'j' [-Wunused-variable]
    6 |     int n, xm, i, j, x, y;
      |                   ^
Main.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d %d", &n, &xm);
      |     ~~~~~^~~~~~~~~~~~~~~~~~
Main.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%d %d", &x, &y);
      |         ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 5048 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -