Submission #1304829

#TimeUsernameProblemLanguageResultExecution timeMemory
1304829islam_2010Palindromes (info1cup18_palindromes)C++20
100 / 100
205 ms724 KiB
#pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; // typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; #define rall(x) x.rbegin(), x.rend() #define all(x) x.begin(), x.end() #define pii pair<int, int> #define int long long #define pb push_back #define se second #define fi first #define endl "\n" mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int mod = 1e5+5; const int sz = 2e5+5; const int inf = 1e9 + 7; int bin_pow(int x, int b) { int res = 1; while (b > 0) { if (b & 1) { res = (res * x) % mod; } x = (x * x) % mod; b >>= 1; } return res; } struct modint { int x; modint(int val): x(val) {} modint operator*(modint other) { return 1LL*x*other.x%mod; } modint operator-(modint other) { return (x-other.x)%mod; } modint operator+(modint other) { return (x+other.x)%mod; } }; int ans; void _(){ int a; cin >> a; string s = to_string(a); string c = s; reverse(all(s)); if(s == c){ ans += a; } } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); // freopen("main.in", "r", stdin); // freopen("main.out", "w", stdout); int t; cin >> t; while (t--){ _(); }cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...