CSES - Datatähti 2016 alku - Results
Submission details
Task:Osajono
Sender:BigKappa
Submission time:2015-10-02 10:45:35 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:18: error: 'strlen' was not declared in this scope
  int n = strlen(m);
                  ^
input/code.cpp:18:2: error: expected '}' at end of input
  }
  ^

Code

#include <iostream>
#include <string>

using namespace std;

int main() {
	string m;
	cin >> m;
	int n = strlen(m);
	int o = n;
	for (int l = 1; l <= n; l++){
		for( int i = 0; i <= n-l;i++){
			if(m[i] == m[i+l]){
				o++;
			}
		}
	return o;
	}