Submission #382921

#TimeUsernameProblemLanguageResultExecution timeMemory
382921IwanttobreakfreeKarte (COCI15_karte)C++17
50 / 50
1 ms364 KiB
#include <iostream> #include <vector> using namespace std; int main(){ char c; bool pos=true; int n; vector<vector<bool> >v(4,vector<bool> (13)); for(int i=0;i<4;i++){ for(int j=0;j<13;j++){ v[i][j]=false; } } while(cin>>c){ cin>>n; n--; if(c=='P'){ if(!v[0][n])v[0][n]=true; else { pos=false; break; } } else if(c=='K'){ if(!v[1][n])v[1][n]=true; else { pos=false; break; } } else if(c=='H'){ if(!v[2][n])v[2][n]=true; else { pos=false; break; } } else{ if(!v[3][n])v[3][n]=true; else { pos=false; break; } } } int cont=0; if(!pos)cout<<"GRESKA\n"; else { for(int i=0;i<4;i++){ cont=0; for(int j=0;j<13;j++){ if(!v[i][j])cont++; } cout<<cont<<' '; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...