Submission #517799

#TimeUsernameProblemLanguageResultExecution timeMemory
517799thegrimbeePalindromic FizzBuzz (NOI19_palindrome)C++14
100 / 100
22 ms1872 KiB
#include <bits/stdc++.h> #define int long long using namespace std; bool check(string s){ for (int i = 0; i < s.size() / 2; ++i){ if (s[i] != s[s.size()-1-i])return false; } return true; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); int S, E; cin >> S >> E; for (int i = S; i <=E; ++i){ if (check(to_string(i)))cout << "Palindrome!\n"; else cout << i << '\n'; } }

Compilation message (stderr)

palindrome.cpp: In function 'bool check(std::string)':
palindrome.cpp:5:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 |  for (int i = 0; i < s.size() / 2; ++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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...