621 - Secret Research

All about problems in Volume 6. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

BaronRED
New poster
Posts: 3
Joined: Sun Jun 28, 2015 4:40 pm

Re: 621 - Secret Research

Post by BaronRED »

My mind is blowing, I got 11 Runtime Error but I can't find where is the problem! Damn! And more important, I'm exactly sure: RE means that there was a problem while my program was running, right? Is possible to know which kind of error?
Please I'm going mad!

Code: Select all

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <regex>

int main (){
	std::regex neg ("[0-9]*35");
	std::regex failed ("9[0-9]*4");
	std::regex notComp ("190[0-9]*");
	std::string exper;
	long long N;
	scanf ("%lld", &N);
	for (long long i=0; i<N; i++){
		std::cin >> exper;
		if (strcmp(exper.c_str(), "1") == 0 || strcmp(exper.c_str(), "4") == 0 || strcmp(exper.c_str(), "78") == 0){
			std::cout << ((i==N-1)? "+" : "+\n");
			continue;
		}
		if (std::regex_match(exper, neg)){
			std::cout << ((i==N-1)? "-" : "-\n");
			continue;
		}
		if (std::regex_match(exper, failed)){
			std::cout << ((i==N-1)? "*" : "*\n");
			continue;
		}
		if (std::regex_match(exper, notComp)){
			std::cout << ((i==N-1)? "?" : "?\n");
			continue;
		}
	}
	return 0;
}
I did it both with regex and not, but still RE. D:
Post Reply

Return to “Volume 6 (600-699)”