제출 #45961

#제출 시각아이디문제언어결과실행 시간메모리
45961RezwanArefin01Aliens (IOI16_aliens)C++17
0 / 100
2 ms596 KiB
#include <bits/stdc++.h> #include "aliens.h" using namespace std; int g[50][50]; long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) { int ret = 0; if(n != k) exit(0); for(int i = 0; i < n; i++) { if(r[i] > c[i]) swap(r[i], c[i]); for(int j = r[i]; j <= c[i]; j++) { for(int k = r[i]; k <= c[i]; k++) { if(!g[j][k]) ret++; g[j][k] = 1; } } } return ret; } #ifdef LOCAL_TESTING int main() { freopen("in", "r", stdin); int n, m, k; assert(3 == scanf("%d %d %d", &n, &m, &k)); std::vector<int> r(n), c(n); for (int i = 0; i < n; i++) { assert(2 == scanf("%d %d", &r[i], &c[i])); } long long ans = take_photos(n, m, k, r, c); printf("%lld\n", ans); return 0; } #endif
#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...