Submission #899592

#TimeUsernameProblemLanguageResultExecution timeMemory
899592pccPalindromic FizzBuzz (NOI19_palindrome)C++14
100 / 100
11 ms1884 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tlll tuple<ll,ll,ll> inline bool check(ll k){ string s = to_string(k); for(int i = 0;i<s.size();i++){ if(s.end()[-i-1] != s[i])return false; } return true; } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); ll s,e; cin>>s>>e; for(ll i = s;i<=e;i++){ if(check(i))cout<<"Palindrome!\n"; else cout<<i<<'\n'; } return 0; }

Compilation message (stderr)

palindrome.cpp: In function 'bool check(long long int)':
palindrome.cpp:14:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...