Skip to content

Commit

Permalink
Add 12174.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Feb 22, 2024
1 parent d08d4ad commit e489efb
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 12xxx/12174.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <iostream>
#include <string>
using namespace std;

void solve(int idx) {
int b; cin >> b;
string s; cin >> s;

cout << "Case #" << idx << ": ";
for (int i=0; i<8*b; i+=8) {
int x = 0;
for (int j=0; j<8; j++) {
x <<= 1;
x += (s[i+j] == 'I');
}
cout << (char)x;
}
cout << "\n";
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

int t; cin >> t;
cin.ignore();
for (int i=1; i<=t; i++) solve(i);
return 0;
}

0 comments on commit e489efb

Please sign in to comment.