# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
786436 | LIF | Aliens (IOI16_aliens) | C++14 | 1 ms | 432 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "aliens.h"
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int rr[300005];
int cc[300005];
int color[305][305];
int dp[1005][1005];
struct node
{
int r;
int c;
}nod[500005];
bool cmp(node x,node y)
{
return x.r < y.r;
}
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
for(int i=0;i<r.size();i++)rr[i+1] = r[i];
for(int i=0;i<c.size();i++)cc[i+1] = c[i];
bool flag2 = true;
for(int i=1;i<=n;i++)
{
if(rr[i] > cc[i])swap(rr[i],cc[i]);
if(rr[i] != cc[i])flag2 = false;
}
if(k == n && m <= 100)
{
for(int i=1;i<=n;i++)
{
for(int j=min(rr[i],cc[i]);j<=max(rr[i],cc[i]);j++)
{
for(int k=min(rr[i],cc[i]);k<=max(rr[i],cc[i]);k++)color[j][k] = 1;
}
}
int cnt = 0;
for(int i=0;i<=m-1;i++)
{
for(int j=0;j<=m-1;j++)if(color[i][j] == 1)cnt++;
}
return cnt;
}
if(flag2 == true)
{
for(int i=1;i<=n;i++)
{
nod[i].r = rr[i];
nod[i].c = cc[i];
}
}
return 0;
}
Compilation message (stderr)
# | 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... |