Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- int main(){
- int n;
- cin >> n;
- string s;
- cin >> s;
- string two = s;
- for(int i = 0; i < n; i++) {
- if(two[i] == '?') {
- two[i] = '2';
- }
- }
- int cnt = 0;
- for(int i = 0; i < n; i++) {
- if(two[i] == '2') {
- cnt++;
- }
- else {
- cnt = 0;
- }
- if(cnt >= 2) {
- cout << "cool" << endl;
- return 0;
- }
- }
- string three = s;
- cnt = 0;
- for(int i =0 ; i < n; i++) {
- if(three[i] == '?') {
- three[i] = '3';
- }
- }
- for(int i = 0; i < n; i++) {
- if(three[i] == '3') {
- cnt++;
- }
- else {
- cnt = 0;
- }
- if(cnt >= 3) {
- cout << "cool" << endl;
- return 0;
- }
- }
- string fives = s;
- for(int i = 0; i < n; i++) {
- if(fives[i] == '?') {
- fives[i] = '5';
- }
- }
- cnt = 0;
- for(int i = 0; i < n; i++) {
- if(fives[i] == '5'){
- cnt++;
- }
- else {
- cnt = 0;
- }
- if(cnt >= 5) {
- cout << "cool" << endl;
- return 0;
- }
- }
- string sevens = s;
- for(int i = 0; i < n; i++) {
- if(sevens[i] == '?') {
- sevens[i] = '7';
- }
- }
- cnt = 0;
- for(int i = 0; i < n; i++) {
- if(sevens[i] == '7') {
- cnt++;
- }
- else {
- cnt = 0;
- }
- if(cnt >= 7) {
- cout << "cool" << endl;
- return 0;
- }
- }
- cout << "boring" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement