Submission #80805

#TimeUsernameProblemLanguageResultExecution timeMemory
80805farukkastamonudaPalindromes (info1cup18_palindromes)C++14
100 / 100
288 ms10236 KiB
#include <bits/stdc++.h> #define fi first #define se second #define lo long long #define inf 1000000000 #define md 1000000007 #define li 2005 #define mp make_pair #define pb push_back using namespace std; int n, x, xx; lo int sum; vector < int > v; int main(){ scanf("%d", &n); for(int i = 1;i <= n; i++){ scanf("%d", &x); xx = x; //vector< int > v; while(x){ v.pb(x % 10); x /= 10; } int flag = 0; int bas = 0, son = (int)v.size() - 1; while(bas < son){ if(v[bas] != v[son]){ flag = 1; break; } bas++; son--; } if(flag == 0) sum += xx; v.clear(); } printf("%lld", sum); return 0; }

Compilation message (stderr)

palindromes.cpp: In function 'int main()':
palindromes.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
palindromes.cpp:17:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &x);
   ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...