提出 #43057581
ソースコード 拡げる
#include <bits/stdc++.h>
#define lll __int128
#define ull unsigned long long
#define ulll unsigned lll
#define ll long long
#define lchild 2*node
#define rchild lchild+1
#define mx 200007
#define endl '\n'
#define inf 10000000
#define mod 1000000007
#define pii pair<int,int>
#define ld long double
#define ff first
#define ss second
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;
bool isPal(string s)
{
for(int i=0;i<s.size()/2;i++)
if(s[i]!=s[s.size()-i-1])
return 0;
return 1;
}
int main ()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int tc= 1;
// cin>>tc;
while(tc--)
{
int n;
cin>>n;
string s[n+5];
for(int i=0;i<n;i++)
cin>>s[i];
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
if(isPal(s[i]+s[j]) or isPal(s[j]+s[i]))
return cout<<"Yes\n", 0;
}
}
cout<<"No\n";
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - racecar |
| ユーザ | aritra741 |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 200 |
| コード長 | 1363 Byte |
| 結果 | AC |
| 実行時間 | 8 ms |
| メモリ | 3600 KiB |
コンパイルエラー
./Main.cpp: In function ‘bool isPal(std::string)’:
./Main.cpp:30:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
30 | for(int i=0;i<s.size()/2;i++)
| ~^~~~~~~~~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_00.txt | AC | 6 ms | 3416 KiB |
| example_01.txt | AC | 2 ms | 3540 KiB |
| example_02.txt | AC | 2 ms | 3468 KiB |
| hand_00.txt | AC | 3 ms | 3552 KiB |
| hand_01.txt | AC | 3 ms | 3536 KiB |
| hand_02.txt | AC | 4 ms | 3592 KiB |
| hand_03.txt | AC | 1 ms | 3480 KiB |
| hand_04.txt | AC | 2 ms | 3548 KiB |
| hand_05.txt | AC | 2 ms | 3548 KiB |
| hand_06.txt | AC | 3 ms | 3464 KiB |
| random_00.txt | AC | 4 ms | 3532 KiB |
| random_01.txt | AC | 3 ms | 3548 KiB |
| random_02.txt | AC | 3 ms | 3600 KiB |
| random_03.txt | AC | 5 ms | 3472 KiB |
| random_04.txt | AC | 4 ms | 3560 KiB |
| random_05.txt | AC | 3 ms | 3480 KiB |
| random_06.txt | AC | 3 ms | 3592 KiB |
| random_07.txt | AC | 3 ms | 3484 KiB |
| random_08.txt | AC | 4 ms | 3596 KiB |
| random_09.txt | AC | 5 ms | 3596 KiB |
| random_10.txt | AC | 5 ms | 3456 KiB |
| random_11.txt | AC | 4 ms | 3476 KiB |
| random_12.txt | AC | 4 ms | 3480 KiB |
| random_13.txt | AC | 3 ms | 3472 KiB |
| random_14.txt | AC | 3 ms | 3476 KiB |
| random_15.txt | AC | 4 ms | 3564 KiB |
| random_16.txt | AC | 8 ms | 3484 KiB |
| random_17.txt | AC | 3 ms | 3484 KiB |
| random_18.txt | AC | 3 ms | 3596 KiB |
| random_19.txt | AC | 4 ms | 3592 KiB |