Submission #1121500

#TimeUsernameProblemLanguageResultExecution timeMemory
1121500vjudge1Boarding Passes (BOI22_passes)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; int n, g; string s; int main() { cin >> s; for(int i = 0; i < s.size(); i++) { g = max(s[i] - 'A', g); } long long n = s.size(); if(g == 0) { cout << fixed << setprecision(12) << n * (n - 1.0)/4; return 0; } cout << 1 << "\n"; }

Compilation message (stderr)

passes.cpp: In function 'int main()':
passes.cpp:7:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for(int i = 0; i < s.size(); i++) {
      |                    ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...