제출 #1004960

#제출 시각아이디문제언어결과실행 시간메모리
1004960salmonTiles (BOI24_tiles)C++14
0 / 100
29 ms348 KiB
#include <bits/stdc++.h> using namespace std; int N,M; int fx,fy; int px,py; int x,y; map<int,set<pair<int,int>>> mep; int fum = 1.1e9; int main(){ scanf(" %d",&N); scanf(" %d",&M); scanf(" %d",&fx); scanf(" %d",&fy); px = fx; py = fy; for(int i = 0; i < N - 1; i++){ scanf(" %d",&x); scanf(" %d",&y); if(px == x){ mep.insert({x,{{min(y,py),max(y,py)}} }); if(x % 2 == 1){ fum = x; } } } int num = 0; bool die = false; for(pair<int,set<pair<int,int>>> ii : mep){ set<pair<int,int>> sat = ii.second; num = ii.first - 2; if(ii.first > fum){ num = min(num,fum-1); die = true; break; } bool die = false; for(pair<int,int> ii : sat){ if((ii.second - ii.first)%2 != 0){ die = true; break; } } if(die) break; auto it = mep.upper_bound(ii.first); break; if(it == mep.end()){ num = M; break; } break; } if(die){ printf("%lld\n",num); } else{ for(int i = 0; i < 1 ; i++){ while(!mep.empty() && (mep.begin() -> first) != 4){ mep.erase(mep.begin()); } if(mep.empty()) break; pair<int,set<pair<int,int>>> ii = (*mep.begin()); set<pair<int,int>> sat = ii.second; if(ii.first > fum){ num = min(num,fum-1); die = true; break; } bool die = false; for(pair<int,int> ii : sat){ if((ii.second - ii.first)%2 != 0){ die = true; break; } } if(die) break; auto it = mep.upper_bound(ii.first); break; if(it == mep.end()){ num = M; break; } break; } printf("%d\n",num); } }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:66:14: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=]
   66 |   printf("%lld\n",num);
      |           ~~~^    ~~~
      |              |    |
      |              |    int
      |              long long int
      |           %d
Main.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  scanf(" %d",&N);
      |  ~~~~~^~~~~~~~~~
Main.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |  scanf(" %d",&M);
      |  ~~~~~^~~~~~~~~~
Main.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |  scanf(" %d",&fx);
      |  ~~~~~^~~~~~~~~~~
Main.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |  scanf(" %d",&fy);
      |  ~~~~~^~~~~~~~~~~
Main.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |   scanf(" %d",&x);
      |   ~~~~~^~~~~~~~~~
Main.cpp:24:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |   scanf(" %d",&y);
      |   ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...