| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1027182 | cnn008 | Sure Bet (CEOI17_sure) | C++17 | 78 ms | 2396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#ifdef N_N_C
#include "debug.h"
#else
#define cebug(...) "Arya"
#endif
#define int long long
#define double long double
const int N=1e5+5;
const int mod=1e9+7;
int n;
double a[N],b[N],ans;
void sol(){
cin>>n;
assert(n<=10);
for(int i=1; i<=n; i++) cin>>a[i];
for(int i=1; i<=n; i++) cin>>b[i];
for(int ma=1; ma<(1<<n); ma++){
for(int mb=1; mb<(1<<n); mb++){
double s1=0,s2=0;
double v1=0,v2=0;
for(int i=0; i<n; i++) if((ma>>i)&1) v1+=1.0,s1+=a[i+1];
for(int i=0; i<n; i++) if((mb>>i)&1) v2+=1.0,s2+=b[i+1];
ans=max(ans,min(s1-v1-v2,s2-v1-v2));
}
}
cout<<fixed<<setprecision(4)<<ans;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// freopen(".inp", "r", stdin);
// freopen(".out", "w", stdout);
int tt=1;
//cin>>tt;
while(tt--){
sol();
}
cerr << "\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms.\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... | ||||
