Submission #132871

#TimeUsernameProblemLanguageResultExecution timeMemory
132871MasterdanAliens (IOI16_aliens)C++14
4 / 100
2 ms504 KiB
#include "aliens.h" #include <bits/stdc++.h> #define MIN -1 #define MAX 10000000000 #define all(a) a.begin (), a.end () using namespace std; typedef vector <int> vi; typedef long long int ll; typedef pair <int, int> ii; int M[110][110]; void paint(int a, int b){ for(int i=a;i<=b;i++){ for(int j=a;j<=b;j++){ M[i][j]=1; } } } long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { int s=0; memset(M, 0, sizeof m*m); for(int i=0;i<n;i++){ paint(min(r[i], c[i]), max(r[i], c[i])); } for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ if(M[i][j]==1)s++; } } /*for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ cout<<M[i][j]<<" "; }cout<<endl; }*/ return s; } /* int main() { 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; } */
#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...