#include "aliens.h"
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define pb push_back
#define mp make_pair
#define rept(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define vec vector
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef vec<int> vi;
typedef vec<vi> v2i;
typedef pair<int, int> pi;
typedef vec<pi> vpi;
typedef vec<bool> vb;
ll s1(int n, int m, vi& r, vi& c) {
ll ans = 0;
v2i g(m, vi(m, 0));
rep(i, n) {
if (r[i] > c[i]) swap(r[i], c[i]);
rept(y, r[i], c[i]+1) {
rept(x, r[i], c[i]+1) {
if (g[y][x] == 0) ans++;
g[y][x] = 1;
}
}
}
return ans;
}
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
return s1(n, m, r, c);
}
컴파일 시 표준 에러 (stderr) 메시지
aliens.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
aliens_c.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
# | 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... |