# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
28743 |
2017-07-16T12:38:22 Z |
repeating |
Aliens (IOI16_aliens) |
C++11 |
|
139 ms |
3020 KB |
#include <bits/stdc++.h>
#include "aliens.h"
#define F first
#define S second
#define P push
#define pb push_back
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define W while
#define R return
#define C continue
#define SI size()
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define SF(x) scanf("%I64d",&x)
#define SF2(x,y) scanf("%I64d%I64d",&x,&y)
#define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z)
#define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o)
#define all(v) v.begin(),v.end()
using namespace std;
const long long INF = 1e8;
const int MX=200015;
int n,m,k;
int dp[505][505];
int a[505];
int DP(int x,int y){
if(x==n)R 0;
if(y==k)R INF;
int &ret=dp[x][y];
if(ret!=-1)R ret;
ret=INF;
for(int i=x;i<n;i++){
ret=min(ret,DP(i+1,y+1)+(a[i]-a[x]+1)*(a[i]-a[x]+1));
}
R ret;
}
long long take_photos(int n_, int m_, int k_, vector<int> r, vector<int> c) {
MEM(dp,-1);
n=n_,m=m_,k=k_;
for(int i=0;i<n;i++){
a[i]=r[i];
}
sort(a,a+n);
return DP(0,0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3020 KB |
Wrong answer: output = 1, expected = 4 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 1 |
2 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 4 |
3 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 1 |
4 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 5 |
5 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 41 |
6 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 71923 |
7 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 77137 |
8 |
Correct |
109 ms |
3020 KB |
Correct answer: answer = 764 |
9 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 250000 |
10 |
Correct |
116 ms |
3020 KB |
Correct answer: answer = 500 |
11 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 32 |
12 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 130050 |
13 |
Correct |
29 ms |
3020 KB |
Correct answer: answer = 5110 |
14 |
Correct |
3 ms |
3020 KB |
Correct answer: answer = 2626 |
15 |
Correct |
9 ms |
3020 KB |
Correct answer: answer = 796 |
16 |
Correct |
23 ms |
3020 KB |
Correct answer: answer = 7580 |
17 |
Correct |
69 ms |
3020 KB |
Correct answer: answer = 1904 |
18 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 996004 |
19 |
Correct |
13 ms |
3020 KB |
Correct answer: answer = 38817 |
20 |
Correct |
59 ms |
3020 KB |
Correct answer: answer = 4096 |
21 |
Correct |
0 ms |
3020 KB |
Correct answer: answer = 1 |
22 |
Correct |
119 ms |
3020 KB |
Correct answer: answer = 1 |
23 |
Correct |
73 ms |
3020 KB |
Correct answer: answer = 2040 |
24 |
Correct |
139 ms |
3020 KB |
Correct answer: answer = 2 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3020 KB |
Wrong answer: output = 1, expected = 4 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3020 KB |
Wrong answer: output = 1, expected = 4 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3020 KB |
Wrong answer: output = 1, expected = 4 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
3020 KB |
Wrong answer: output = 1, expected = 4 |
2 |
Halted |
0 ms |
0 KB |
- |