MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / solve

Function solve

CodeChef_problems/Ada King/solution.cpp:59–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57*/
58
59void solve(){
60 ll n; cin>>n;
61 vector<vector<char>> v(8,vector<char> (8,'.'));
62 n--;
63
64 v[0][0]='O';
65 for(int i=0;i<8;i++){
66 for(int j=0;j<8;j++){
67 if(!i && !j) continue; //Exclude the origin (0,0)
68 if(n==0){
69 v[i][j]='X';
70 }
71 else{
72 n--;
73 }
74 }
75 }
76
77 for(auto c: v){
78 for(auto k: c){
79 cout<<k;
80 }
81 cout<<endl;
82 }
83
84}
85
86
87int main(){

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected