CSES - Datatähti 2016 alku - Results
Submission details
Task:Osajono
Sender:MM
Submission time:2015-10-10 19:20:35
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.05 s1details
#20.06 s1details
#30.05 s1details
#40.05 s1details
#50.05 s1details
#60.05 s2details
#70.06 s2details
#80.05 s2details
#90.06 s2details
#100.05 s2details
#110.05 s3details
#120.05 s3details
#130.05 s3details
#140.05 s3details
#150.05 s3details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:13:2: warning: 'char* gets(char*)' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
  gets(line);
  ^
input/code.cpp:13:11: warning: 'char* gets(char*)' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
  gets(line);
           ^
input/code.cpp:13:12: warning: ignoring return value of 'char* gets(char*)', declared with attribute warn_unused_result [-Wunused-result]
  gets(line);
            ^
output/ccPWzKUo.o: In function `main':
code.cpp:(.text.startup+0x44): warning: the `gets' function is dangerous and should not be used.

Code

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

int main() {
	int i, j;
	unsigned long long summa;
	char c;
	char line [100000];
	char merkki [256];
	int maara [256];
	for (i=0;i<256;i++)
		merkki[i]=maara[i]=0;
	gets(line);
	printf("%s\n", line);
	for (i=0;(c=line[i])!='\0';i++) {
		for (j=0;merkki[j]!=c && merkki[j]!=0;j++);
		merkki[j]=c;
		maara[j]++;
	}
	for(summa=i=0;maara[i]!=0;i++) {
		summa += maara[i] + (maara[i] * (maara[i] - 1)) / 2;
	}
	printf("%llu", summa);
	return 0;
}

Test details

Test 1

Group: 1

Verdict:

input
BBBAABBBAAAABBAAAABAABAABBBBBB...

correct output
2554

user output
BBBAABBBAAAABBAAAABAABAABBBBBB...

Test 2

Group: 1

Verdict:

input
GDFVYWQCZAFGICSXOSWBZMGPDBSSVL...

correct output
299

user output
GDFVYWQCZAFGICSXOSWBZMGPDBSSVL...

Test 3

Group: 1

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAZAAAA...

correct output
4314

user output
AAAAAAAAAAAAAAAAAAAAAAAAAZAAAA...

Test 4

Group: 1

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4231

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Test 5

Group: 1

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
5050

user output
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

Test 6

Group: 2

Verdict:

input
BBABABBBABBAABBABBABAABAAABABA...

correct output
6253029

user output
BBABABBBABBAABBABBABAABAAABABA...

Test 7

Group: 2

Verdict:

input
RBKJMLDVQMKHYKCNDIVVKOMFUXTFMG...

correct output
485173

user output
RBKJMLDVQMKHYKCNDIVVKOMFUXTFMG...

Test 8

Group: 2

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
12427725

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Test 9

Group: 2

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
12467549

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Test 10

Group: 2

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
12502500

user output
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

Test 11

Group: 3

Verdict:

input
BAAAAABABBABAABAABABABBBABBAAB...

correct output
2500051369

user output
BAAAAABABBABAABAABABABBBABBAAB...

Test 12

Group: 3

Verdict:

input
ABBURXDRVXAYBPXXOQZNYHLWGUEEWR...

correct output
192407124

user output
ABBURXDRVXAYBPXXOQZNYHLWGUEEWR...

Test 13

Group: 3

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4998050400

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Test 14

Group: 3

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4998850144

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Test 15

Group: 3

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
5000050000

user output
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...