답안 #990745

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
990745 2024-05-31T07:12:12 Z vjudge1 Dijamant (COI16_dijament) C++17
0 / 100
1 ms 600 KB
#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;
	for(int i=0;i<n;i++){
		string s;
		getline(cin,s);
		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];
		}
		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

dijament.cpp: In function 'int main()':
dijament.cpp:18:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   for(int i=0;i<s.length();i++){
      |               ~^~~~~~~~~~~
dijament.cpp:31: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]
   31 |   for(int i=2;i<(v.size())-1;i++)
      |               ~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -