Submission #614337

# Submission time Handle Problem Language Result Execution time Memory
614337 2022-07-31T01:54:24 Z Plurm Boarding Passes (BOI22_passes) C++11
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

char s[100005];
double solve(int n) {
  double ans = ((n / 4) * (n + 1) + (n % 4 == 3 ? 1 : 0)) / 2.0;
  return max(ans, 0.0);
}
int main() {
  scanf("%s", s);
  int n = strlen(s);
  printf("%.6f\n", solve(n));
}

Compilation message

passes.cpp: In function 'int main()':
passes.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   scanf("%s", s);
      |   ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB found '100800.5000000000', expected '100800.5000000000', error '0.0000000000'
2 Correct 0 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
3 Correct 0 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
4 Incorrect 0 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '2.5000000000', error = '1.5000000000'
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '3.5000000000', error = '2.5000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '3.5000000000', error = '2.5000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB found '100800.5000000000', expected '100800.5000000000', error '0.0000000000'
2 Correct 0 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
3 Correct 0 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
4 Incorrect 0 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '2.5000000000', error = '1.5000000000'
5 Halted 0 ms 0 KB -