제출 #1211683

#제출 시각아이디문제언어결과실행 시간메모리
1211683cpdreamerAliens (IOI16_aliens)C++20
0 / 100
0 ms324 KiB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
const long long  INF = 1e12;
typedef long long ll;
const ll MOD=(ll) 998244353;
#define P pair
#define S second
#define F first
#define pb push_back
#define V vector
#define all(v) v.begin(),v.end()
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
    V<int>d;
    sort(all(r));
    auto it=unique(all(r));
    r.resize(distance(r.begin(),it));
    int s=(int)r.size();
    for(int i=0;i<s;i++){
        d.pb(r[i+1]-r[i]);
    }
    sort(all(d));
    ll cost=s;
    for(int i=0;i<s-k;i++){
        cost+=d[i]-1;
    }
    return cost;

}

컴파일 시 표준 에러 (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 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...