Submission #73080172
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s = to_string(n);
for(int i = 1; i < s.length(); i++){
if(s[i] != s[i-1]) {
cout << "No";
return 0;
}
}
cout << "Yes";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Repdigit |
| User | ShubhSareen |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 297 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3504 KiB |
Compile Error
./Main.cpp: In function 'int main()':
./Main.cpp:8:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
8 | for(int i = 1; i < s.length(); i++){
| ~~^~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt |
| All | 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt, 1_1.txt, 2_1.txt, 2_2.txt, 2_3.txt, 2_4.txt, 3_1.txt, 3_2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_sample_1.txt | AC | 1 ms | 3404 KiB |
| 0_sample_2.txt | AC | 1 ms | 3404 KiB |
| 0_sample_3.txt | AC | 1 ms | 3348 KiB |
| 1_1.txt | AC | 1 ms | 3504 KiB |
| 2_1.txt | AC | 1 ms | 3404 KiB |
| 2_2.txt | AC | 1 ms | 3396 KiB |
| 2_3.txt | AC | 1 ms | 3380 KiB |
| 2_4.txt | AC | 1 ms | 3416 KiB |
| 3_1.txt | AC | 1 ms | 3464 KiB |
| 3_2.txt | AC | 1 ms | 3380 KiB |