Submission #40214342
Source Code Expand
Copy
/*#pragma GCC optimize("Ofast,unroll-loops")#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")*/#include <bits/stdc++.h>#define taskname ""#define all(x) x.begin(), x.end()#define ll long long#define ld long double#define pb push_back#define ff first#define ss second#define pii pair<int, int>#define vi vector<int>using namespace std;const int mxN = 2e5 + 5;const int mod = 1e9 + 7;const ll oo = 1e18;
/* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt") */ #include <bits/stdc++.h> #define taskname "" #define all(x) x.begin(), x.end() #define ll long long #define ld long double #define pb push_back #define ff first #define ss second #define pii pair<int, int> #define vi vector<int> using namespace std; const int mxN = 2e5 + 5; const int mod = 1e9 + 7; const ll oo = 1e18; int n; string s; void solve() { cin >> n >> s; for(int i = 1; i < n; ++i) { if(s[i] == s[i - 1]) { cout << "No\n"; return; } } cout << "Yes\n"; } signed main() { #ifndef CDuongg if(fopen(taskname".inp", "r")) assert(freopen(taskname".inp", "r", stdin)), assert(freopen(taskname".out", "w", stdout)); #else freopen("bai3.inp", "r", stdin); freopen("bai3.out", "w", stdout); auto start = chrono::high_resolution_clock::now(); #endif ios_base::sync_with_stdio(false); cin.tie(nullptr); int t = 1; //cin >> t; while(t--) solve(); #ifdef CDuongg auto end = chrono::high_resolution_clock::now(); cout << "\n"; for(int i = 1; i <= 100; ++i) cout << '='; cout << "\nExecution time: " << chrono::duration_cast<chrono::milliseconds> (end - start).count() << "[ms]" << endl; #endif }
Submission Info
Submission Time | |
---|---|
Task | A - Alternately |
User | bimatbatmi |
Language | C++ (GCC 9.2.1) |
Score | 100 |
Code Size | 1375 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 3604 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
random_01.txt | AC | 8 ms | 3508 KB |
random_02.txt | AC | 2 ms | 3592 KB |
random_03.txt | AC | 2 ms | 3524 KB |
random_04.txt | AC | 2 ms | 3444 KB |
random_05.txt | AC | 2 ms | 3456 KB |
random_06.txt | AC | 3 ms | 3592 KB |
random_07.txt | AC | 2 ms | 3524 KB |
random_08.txt | AC | 1 ms | 3528 KB |
sample_01.txt | AC | 2 ms | 3600 KB |
sample_02.txt | AC | 2 ms | 3600 KB |
sample_03.txt | AC | 2 ms | 3604 KB |