제출 #1121507

#제출 시각아이디문제언어결과실행 시간메모리
1121507vjudge1Boarding Passes (BOI22_passes)C++17
0 / 100
1 ms336 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) { double ans = 1e18; for(int i = 0; i <= n; i++) { ans = min(ans, i * (i-1.0)/4 + (n-i) * (n-i-1.0)/4); } cout << ans << "\n"; return 0; } cout << 1 << "\n"; }

컴파일 시 표준 에러 (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...