Submission #967761

#TimeUsernameProblemLanguageResultExecution timeMemory
967761amine_arouaAliens (IOI16_aliens)C++17
0 / 100
0 ms348 KiB
#pragma once #include <bits/stdc++.h> using namespace std; #define fore(i , n) for(int i = 0;i<n;i++) #define forr(i , x , y) for(int i = x;i<=y;i++) #define ll long long #define pb push_back const ll INF = 1e18; long long take_photos(int n, int m, int g, std::vector<int> r, std::vector<int> c) { if(n == 1) return 1ll; ll dp[n + 1][g + 1]; fore(i , n + 1) fore(j , g + 1) dp[i][j]= INF; r.pb(0); sort(r.begin() , r.end()); dp[0][0] = 0; forr(i , 1 , n) { forr(j , 1 , g) { for(int l = 0 ; l < i ; l++) { dp[i][j] = min(dp[i][j] , dp[l][j - 1] + (r[i] - r[l + 1] + 1) * (r[i] - r[l + 1] + 1)); } } } return dp[n][g]; }

Compilation message (stderr)

aliens.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...