QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#454521#254. Palindrome NumbersMehdi_Ba0 0ms3540kbC++14641b2024-06-25 00:56:242024-06-25 00:56:24

Judging History

This is the latest submission verdict.

  • [2024-06-25 00:56:24]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 3540kb
  • [2024-06-25 00:56:24]
  • Submitted

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;
}

詳細信息

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'