이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |