제출 #592819

#제출 시각아이디문제언어결과실행 시간메모리
592819PiejanVDCAliens (IOI16_aliens)C++17
4 / 100
1 ms304 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; long long take_photos(int n, int m, int k, vector<int>r, vector<int>c) { vector<pair<int,int>>v(n); for(int i = 0 ; i < n ; i++) v[i] = {r[i], c[i]}; sort(v.begin(), v.end()); long long ans = 0; int mx = -1; vector<vector<bool>>vis(m, vector<bool>(m, 0)); for(auto z : v) { if(vis[z.first][z.second]) continue; for(int i = min(z.first, z.second) ; i <= max(z.first, z.second) ; i++) for(int j = min(z.first, z.second) ; j <= max(z.first, z.second) ; j++) vis[i][j] = 1; } for(auto z : vis) for(auto zz : z) ans += zz; return ans; }

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

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:15:9: warning: unused variable 'mx' [-Wunused-variable]
   15 |     int mx = -1;
      |         ^~
#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...