# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
231208 | mohamedsobhi777 | Mountains (IOI17_mountains) | C++14 | 177 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
Pure bruteforce
*/
#include "mountains.h"
#include <bits/stdc++.h>
using namespace std ;
int maximum_deevs(std::vector<int> y) {
int ret = 0 ;
int n = y.size() ;
for(int i = 1 ; i < (1<<n) ; i++){
vector<pair<int , int> > prs ;
for(int j = 0 ;j < n ;j++){
if(i &(1<<j)){
prs.push_back({j , y[j]}) ;
}
}
if(prs.size() < ret) continue ;
bool okk = 1 ;
for(int j = 0 ; j < prs.size() ; j++){
for(int k = j +1 ; k < prs.size() ; k++){
bool ok = 0 ;
for(int l = prs[j].first +1 ; l < prs[k].first ; l++){
complex<int> v1 (l - prs[j].first , y[l] - prs[j].second);
complex<int> v2(prs[k].first - l , prs[k].second - y[l]) ;
int dot = (conj(v1) * v2) .imag() ;
if(dot < 0) ok = 1;
}
if(!ok){
okk = 0 ;
j = prs.size() ;
break ;
}
}
}
if(okk){
ret = max(ret , (int) prs.size()) ;
}
}
return ret;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |