Submission #836181


Source Code Expand

Copy
#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using namespace std;

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

int main(void){
	string s;
	cin >> s;
	int n=s.size();

	int a=-1,b=-1;
	rep(i,n){
		if(i+1<n && s[i]==s[i+1]) a=i+1,b=i+2;
		if(i+2<n && s[i]==s[i+2]) a=i+1,b=i+3;
	}

	cout << a << " " << b << endl;
	return 0;
}

Submission Info

Submission Time
Task D - Unbalanced
User Hec
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1169 Byte
Status AC
Exec Time 11 ms
Memory 512 KB

Judge Result

Set Name Sample Sub1 Sub2
Score / Max Score 0 / 0 200 / 200 200 / 200
Status
AC × 2
AC × 14
AC × 24
Set Name Test Cases
Sample 0_01, 0_02
Sub1 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 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 AC 4 ms 256 KB
0_02 AC 4 ms 256 KB
1_03 AC 4 ms 256 KB
1_04 AC 4 ms 256 KB
1_05 AC 4 ms 256 KB
1_06 AC 4 ms 256 KB
1_07 AC 4 ms 256 KB
1_08 AC 4 ms 256 KB
1_09 AC 4 ms 256 KB
1_10 AC 4 ms 256 KB
1_11 AC 4 ms 256 KB
1_12 AC 4 ms 256 KB
1_13 AC 4 ms 256 KB
1_14 AC 4 ms 256 KB
2_15 AC 11 ms 512 KB
2_16 AC 11 ms 512 KB
2_17 AC 10 ms 512 KB
2_18 AC 10 ms 512 KB
2_19 AC 10 ms 512 KB
2_20 AC 10 ms 512 KB
2_21 AC 11 ms 512 KB
2_22 AC 10 ms 512 KB
2_23 AC 11 ms 512 KB
2_24 AC 11 ms 512 KB