제출 #995345

#제출 시각아이디문제언어결과실행 시간메모리
995345PagodePaivaPortal (BOI24_portal)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector <pair <int, int>> v; for(int i = 0;i < n;i++){ int a, b; cin >> a >> b; v.push_back({a, b}); } if(n <= 2){ cout << -1 << '\n'; return; } int difx = 1e9; sort(v.begin(), v.end()); for(int i = 1;i < n;i++){ if(v[i].first == v[i-1].first) continue; difx = min(difx, v[i].first-v[i-1].first); } for(int i = 0;i < n;i++){ swap(v[i].first, v[i].second); } sort(v.begin(), v.end()); int dify = 1e9; for(int i = 0;i < n;i++){ if(v[i].first == v[i-1].first) continue; dify = min(dify, v[i].first-v[i-1].first); } cout << (difx == (int) 1e9 or dify == (int) 1e9 ? -1 : (difx-1)*(dify-1)) << '\n'; }

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

Main.cpp: In function 'int main()':
Main.cpp:16:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   16 |         return;
      |         ^~~~~~