제출 #960464

#제출 시각아이디문제언어결과실행 시간메모리
960464lucriAliens (IOI16_aliens)C++17
25 / 100
2029 ms2660 KiB
#pragma once #include <bits/stdc++.h> struct intervale{long long b,e;}a[100010]; long long ans[100010][2]; bool comp(intervale a,intervale b) { if(a.b!=b.b)return a.b<b.b; return a.e>b.e; } long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { for(long long i=0;i<n;++i) a[i+1]={std::min(r[i],c[i])+1,std::max(r[i],c[i])+1}; std::sort(a+1,a+n+1,comp); long long poz=1,l2=0; for(long long i=1;i<=n;++i) if(a[i].e>l2) { l2=a[i].e; a[poz++]=a[i]; } n=poz-1; for(int i=1;i<=n;++i) ans[i][0]=1000000000000000000; for(int j=1;j<=k;++j) { for(int i=1;i<=n;++i) { ans[i][1]=1000000000000000000; for(int ii=1;ii<=i;++ii) ans[i][1]=std::min(ans[i][1],ans[ii-1][0]+(a[i].e-a[ii].b+1)*(a[i].e-a[ii].b+1)-std::max(1LL*0,(a[ii-1].e-a[ii].b+1))*(a[ii-1].e-a[ii].b+1)); } for(int i=1;i<=n;++i) { ans[i][0]=ans[i][1]; ans[i][1]=0; } } return ans[n][0]; }

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