Submission #990755

#TimeUsernameProblemLanguageResultExecution timeMemory
990755vjudge1Dijamant (COI16_dijament)C++17
27 / 100
105 ms436 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int const N=105; int const mod=1e9+7; map<string,bool> vis; int main(){ int n; cin>>n; string s; getline(cin,s); for(int i=0;i<n;i++){ getline(cin,s); // cout<<s<<endl; vector<string> v; string t=""; for(int i=0;i<s.length();i++){ if(s[i]==' '){ v.push_back(t); t=""; } else t+=s[i]; } v.push_back(t); if(vis[v[0]]){ cout<<"greska"<<endl; continue; } bool b=1; for(int i=2;i<(v.size())-1;i++) if(vis[v[i]]==0) b=0; if(b==0){ cout<<"greska"<<endl; continue; } vis[v[0]]=1; cout<<"ok"<<endl; } return 0; }

Compilation message (stderr)

dijament.cpp: In function 'int main()':
dijament.cpp:20:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   for(int i=0;i<s.length();i++){
      |               ~^~~~~~~~~~~
dijament.cpp:34:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |   for(int i=2;i<(v.size())-1;i++)
      |               ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...