ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 12.08.2019 14:27:13
ამოცანა: კროსვორდი
მომხმარებელი: keche28
ვერდიქტი: სრული ამოხსნა
შეფასება: 100.0 ქულა
#include <iostream> #include <algorithm> using namespace std; int wordCount(string s) { int counter=0; int ans=0; for(int i=0; i<s.size(); i++) { if (s[i]=='#') { if (counter>1) ans++; counter=0; } else counter ++; } if(counter>1) ans++; return ans; } int main() { int n,rowWords=0,columnWords=0; cin>>n; string rotated[n]; fill_n(rotated,n,""); for(int i=0; i<n; i++) { string s; cin>>s; rowWords+=wordCount(s); for(int j=0; j<n; j++) rotated[j]+=s[j]; } for (int i=0; i<n; i++) columnWords+=wordCount(rotated[i]); /* for(string item : rotated) columnWords+=wordCount(item);*/ cout<<rowWords<<" "<<columnWords; return 0; }
5 ----# --##- ----- -##-- #----
5 4
5 4
YES
100 ######-#--#######--##---##-----#------######-#--#####-------------##---####-#--#----######--#-#-#--- -#---#-#---##------##-#-----##----####--#-#--#---##-#-#-#---#--#-#####-####-#-###-#-#-#####-#-#-#-#- ---#-####-##-######--##-##-----#-#-######-#-##-#-#...
1297 1235
1297 1235
YES
8 --#-##-# ###-##-# ###-##-# -------- ###-#### #---#### ###----# ########
4 2
4 2
YES
25 ########-################ #-----------------------# ################-######## #-----------------------# ####-##############-##### #-----------------------# ---########---########### #------------------------ ########-----###########- #------------------...
24 33
24 33
YES
44 ############################################ -------####-#--#--###--##--##----#--#-###### #---#--#-##-##----####---####-#--#-#---###-# ##--#--#-##-###----#------#---#--####---#--# ---##-----------##-##-######--###-##-##-#### #####--###----#-#####-###-#-...
273 254
273 254
YES
100 -------------------------#-------------------------------------------------------------------------- --###--------------------#-------------------------------------------------------------------------- -#---#-------------------#------------------------...
142 183
142 183
YES
50 ------###----#####-###-####-#####---#######-###### ###--###--#-#####----#--##--#####-#----###----###- --######-######-#---####-##-#####---###-#----#-#-- --###----######--##--###---##--#---#----##-#---##- #---#--#--#--##--#----##-#--##-#-###-###------##-...
323 308
323 308
YES
79 ##--#--####-###-##--#---######-##--##-#-----#---#--#--#--#-#--##--------#####-# #-###--####--#-------#--##---#--#-#---#-###-#---######-----#-####-#-###-#-###-- -------###------###---##-###--#-#--###-----###----##---#-#---###--####--#---#-# -##---##--#--...
772 750
772 750
YES
100 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##-- ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##-- ##--##--##--##--##--##--##--##--##--##--##--##--##...
2500 50
2500 50
YES
100 --##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## #--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--# -##--##--##--##--##--##--##--##--##--##--##--##--#...
2467 1650
2467 1650
YES