-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathA.cpp
More file actions
43 lines (40 loc) · 906 Bytes
/
A.cpp
File metadata and controls
43 lines (40 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define test(t) \
int t; \
cin >> t; \
while (t--)
#define f(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define endl "\n"
#define deb(x) cout << #x << ": " << x << endl;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
void solve() {
string A;
cin >> A;
int i = 0;
int j = A.length() - 1;
while (i < j) {
if (A[i] == A[j]) {
i++;
j--;
} else {
if (i == 0 && A[j] == '0') {
j--;
} else {
cout << "NO" << endl;
return;
}
}
}
cout << "YES" << endl;
}
int main() {
fast;
// test(t)
solve();
return 0;
}