#include "bits/stdc++.h"
using namespace std;
#define ar array
typedef int64_t ll;
#define int ll
const int N = 1e5 + 5;
int pref[N], suff[N];
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
//~ string s; cin>>s;
//~ int n = s.size();
int n; cin>>n;
for(int i=0;i<n;i++){
if(i) pref[i] += pref[i-1];
pref[i] += i;
}
for(int i=n-1;~i;i--){
suff[i] += suff[i+1];
suff[i] += (n - i - 1);
}
int res = pref[n-1];
for(int i=1;i<n;i++){
res = min(res, pref[i-1] + suff[i]);
}
double rr = res / 2.;
cout<<fixed<<setprecision(1)<<rr<<"\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |