답안 #555712

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
555712 2022-05-01T11:42:16 Z Fidan Aliens (IOI16_aliens) C++17
0 / 100
1 ms 340 KB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;

long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
	vector<vector<long long>> dp(n+1, vector<long long> (k+1, n*n+10)); 
	for(ll i=0; i<n; i++){
		r[i]++;
	}
	
	sort(r.begin(), r.end());
	
	for(ll i: r){
		dp[i][1]=(i-r[0]+1)*(i-r[0]+1);
	}
	for(ll i: r){
		for(ll j=1; j<=k; j++){
			dp[i][j]=min(dp[i][j-1], dp[i][j]);
			for(ll h: r){
				if(h>i) break;
				dp[i][j]=min(dp[i][j], dp[h-1][j-1]+(i-h+1)*(i-h+1));
			}
		}
	}
	return dp[r[n-1]][k];
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Wrong answer: output = 1, expected = 4
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Correct answer: answer = 1
2 Correct 0 ms 212 KB Correct answer: answer = 4
3 Correct 0 ms 212 KB Correct answer: answer = 1
4 Correct 0 ms 212 KB Correct answer: answer = 5
5 Runtime error 1 ms 340 KB Execution killed with signal 11
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Wrong answer: output = 1, expected = 4
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Wrong answer: output = 1, expected = 4
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Wrong answer: output = 1, expected = 4
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Wrong answer: output = 1, expected = 4
2 Halted 0 ms 0 KB -