QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#454521 | #254. Palindrome Numbers | Mehdi_Ba | 0 | 0ms | 3540kb | C++14 | 641b | 2024-06-25 00:56:24 | 2024-06-25 00:56:24 |
Judging History
answer
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define pb push_back
#define sz(a) sizeof(a) / sizeof(a[0])
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
void solve(){
string s;
cin >> s;
int n = s.size();
int ind = n / 2;
string a, b;
for(int i = 0; i < ind; i++) a += s[i];
if(n % 2) b += s[ind];
cout << a << b << a << '\n';
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
int t;
cin >> t;
while(t--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3540kb
input:
20 1 9 10 11 12 100 101 102 1111111111111111111111111111111110 1111111111111111111111111111111111 1111111111111111111111111111111112 11111111111111111111111111111111110 11111111111111111111111111111111111 11111111111111111111111111111111112 89999999999999999990000000000000009 99999999999999999999999...
output:
1 9 11 11 11 101 101 101 1111111111111111111111111111111111 1111111111111111111111111111111111 1111111111111111111111111111111111 11111111111111111111111111111111111 11111111111111111111111111111111111 11111111111111111111111111111111111 89999999999999999989999999999999999 99999999999999999999999999...
result:
wrong answer 5th lines differ - expected: '22', found: '11'