Submission #1873337


Source Code Expand

Copy
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ll LINF=1e18;
const ld PI=abs(acos(-1));
string s;

int main(){
	cin >> s;
	
	REP(i,0,s.size()-1) if(s[i]==s[i+1]){cout << i+1 << " " << i+2 << endl; return 0;}
	REP(i,0,s.size()-2) if(s[i]==s[i+2]){cout << i+1 << " " << i+3 << endl; return 0;}
	cout << -1 << " " << -1 << endl;
	return 0;
}

Submission Info

Submission Time
Task D - アンバランス / Unbalanced
User ecasdqina
Language C++14 (GCC 5.4.1)
Score 400
Code Size 664 Byte
Status
Exec Time 5 ms
Memory 512 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_01, 0_02
Sub1 200 / 200 0_01, 0_02, 1_03, 1_04, 1_05, 1_06, 1_07, 1_08, 1_09, 1_10, 1_11, 1_12, 1_13, 1_14
Sub2 200 / 200 0_01, 0_02, 1_03, 1_04, 1_05, 1_06, 1_07, 1_08, 1_09, 1_10, 1_11, 1_12, 1_13, 1_14, 2_15, 2_16, 2_17, 2_18, 2_19, 2_20, 2_21, 2_22, 2_23, 2_24
Case Name Status Exec Time Memory
0_01 1 ms 256 KB
0_02 1 ms 256 KB
1_03 1 ms 256 KB
1_04 1 ms 256 KB
1_05 1 ms 256 KB
1_06 1 ms 256 KB
1_07 1 ms 256 KB
1_08 1 ms 256 KB
1_09 1 ms 256 KB
1_10 1 ms 256 KB
1_11 1 ms 256 KB
1_12 1 ms 256 KB
1_13 1 ms 256 KB
1_14 1 ms 256 KB
2_15 4 ms 512 KB
2_16 4 ms 512 KB
2_17 4 ms 512 KB
2_18 5 ms 512 KB
2_19 4 ms 512 KB
2_20 5 ms 512 KB
2_21 4 ms 512 KB
2_22 5 ms 512 KB
2_23 5 ms 512 KB
2_24 5 ms 512 KB