# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
121233 | 2019-06-26T08:42:54 Z | miguel | Sure Bet (CEOI17_sure) | C++14 | 2 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<double> #define pb push_back #define INF 1e9+7 int n; vi a, b; int main(){ cin>>n; //random_device dev; //mt19937 rng(dev()); //uniform_int_distribution<std::mt19937::result_type> dist6(5,6); //srand((unsigned)time(0)); //int i; //i=(rand()%2)+5; a.pb(INF); b.pb(INF); for(int i=1; i<=n; i++){ double x,y; cin>>x>>y; a.pb(x); b.pb(y); } sort(a.begin(), a.end(), greater<double>()); sort(b.begin(), b.end(), greater<double>()); //for(int i=1; i<=n; i++) cout<<a[i]<<" ";cout<<endl; a[0]=0; b[0]=0; for(int i=1; i<=n; i++){ a[i]+=a[i-1]; } for(int i=1; i<=n; i++){ b[i]+=b[i-1]; } int x=0, y=0; double mx=0; for(int i=0; i<=n; i++){ for(int j=0; j<=n; j++){ int t=i+j; mx=max(min(a[i]-t, b[j]-t), mx);//cout<<min(a[i]-t, b[j]-t)<<" "<<i<<" "<<j<<endl; } } cout<<mx; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |