Submission #580014

#TimeUsernameProblemLanguageResultExecution timeMemory
580014wdjpngBoarding Passes (BOI22_passes)C++17
0 / 100
2 ms468 KiB
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i =0; i<n; i++) #define all(a) a.begin(),a.end() using namespace std; long double f(int n) { return ((long double) n)*((long double) (n-1))/4.0; } signed main() { string s; cin>>s; int n = s.size(); cin>>n; double sum = f(n/2) + f((n+1)/2); cout.precision(10); cout<<f(n/2) + f((n+1)/2)<<'\n'; }

Compilation message (stderr)

passes.cpp: In function 'int main()':
passes.cpp:20:12: warning: unused variable 'sum' [-Wunused-variable]
   20 |     double sum = f(n/2) + f((n+1)/2);
      |            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...