| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1116387 | staszic_ojuz | Semiexpress (JOI17_semiexpress) | C++17 | 1 ms | 336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
bool Contains(const vector<long long> &v, long long x){
for (long long el:v){
if (el==x) return true;
}
return false;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long n, m, kval, a, b, c, t;
cin>>n>>m>>kval>>a>>b>>c>>t;
vector<long long> vect(m);
for (long long i=0;i<m;i++) cin>>vect[i];
long long best=0;
for (long long i=t/a;i<=n;i++){
if (Contains(vect, i)) continue;
long long ubi;
for (long long j=0;j<vect.size();j++){
if (vect[j]>i){
ubi=j;
break;
}
}
for (long long j=i+1;j<=n;j++){
if (i==j||Contains(vect, j)) continue;
long long ubj;
for (long long k=0;k<vect.size();k++){
if (vect[k]>j){
ubj=k;
break;
}
}
long long expstop=0, current=0;
for (long long k=2;k<=n;k++){
if (Contains(vect, k)) expstop++;
long long time=(vect[expstop]-1)*b;
if (expstop==ubj-1&&k>=j){
time+=(j-vect[ubj-1])*c+(k-j)*a;
}
else if (expstop==ubi-1&&k>=i){
time+=(i-vect[ubi-1])*c+(k-i)*a;
}
else time+=(k-vect[expstop])*a;
if (time<=t) current++;
}
if (best<current) best=current;
}
}
cout<<best<<'\n';
return 0;
}컴파일 시 표준 에러 (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... | ||||
