CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:viktor
Submission time:2017-10-04 12:39:50 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.19 sdetails
#20.17 sdetails
#30.18 sdetails
#40.18 sdetails
#50.20 sdetails
#60.20 sdetails
#70.17 sdetails
#80.20 sdetails
#90.17 sdetails
#100.18 sdetails

Compiler report

input/code.cpp: In function 'int main(int, char**)':
input/code.cpp:13:9: warning: statement has no effect [-Wunused-value]
    for(j; j != i; j--)
         ^
input/code.cpp:8:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", str);
                  ^

Code

#include <stdio.h>
#include <string.h>
#include <stdlib.h>


int main(int argc, char *argv[]){
	char *str =(char *) calloc(1000, sizeof(char));
	scanf("%s", str);
	size_t j = 0;
	for(size_t i = 0; i < strlen(str); i++){
		if(str[i] == str[i + 1]){
			for(j = i + 1; str[j] == str[j - 1]; j++);
			for(j; j != i; j--)
				str[j-1] = str[j];

		}
	}
	printf("%s", str);
	free(str);

	return 0;
}

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
ABABABABABABABABABABABABABABAB...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x000000000215c010 ***

Test 2

Verdict:

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
BABABABABABABABABABABABABABABA...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x0000000001157010 ***

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
ABABABABABABABABABABABABABABAB...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x000000000157d010 ***

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
ABABABABABABABABABABABABABABAB...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x0000000000bd3010 ***

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
ACDCACDBACACBDBADBABABACACDACA...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x0000000002307010 ***

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
TFHIJOGACDHMGVFJCMETMZDEITROTE...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x0000000001957010 ***

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
GNLAHLYPRFCZKIKSJWAWYJPCDBNWYM...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x00000000014b4010 ***

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
PISHWMOTCZFRMYMOMYDYGJZIQHSPVA...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x00000000019b8010 ***

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
QUTPXAMWODFXRONJODPGBTCISGMVWR...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x0000000001e09010 ***

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

Error:
*** Error in `input/code': double free or corruption (!prev): 0x0000000000a67010 ***