-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC.java
92 lines (72 loc) · 3.35 KB
/
C.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
/$$$$$ /$$$$$$ /$$ /$$ /$$$$$$
|__ $$ /$$__ $$| $$ | $$ /$$__ $$
| $$| $$ \ $$| $$ | $$| $$ \ $$
| $$| $$$$$$$$| $$ / $$/| $$$$$$$$
/$$ | $$| $$__ $$ \ $$ $$/ | $$__ $$
| $$ | $$| $$ | $$ \ $$$/ | $$ | $$
| $$$$$$/| $$ | $$ \ $/ | $$ | $$
\______/ |__/ |__/ \_/ |__/ |__/
/$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$$$ /$$$$$$$
| $$__ $$| $$__ $$ /$$__ $$ /$$__ $$| $$__ $$ /$$__ $$| $$$ /$$$| $$$ /$$$| $$_____/| $$__ $$
| $$ \ $$| $$ \ $$| $$ \ $$| $$ \__/| $$ \ $$| $$ \ $$| $$$$ /$$$$| $$$$ /$$$$| $$ | $$ \ $$
| $$$$$$$/| $$$$$$$/| $$ | $$| $$ /$$$$| $$$$$$$/| $$$$$$$$| $$ $$/$$ $$| $$ $$/$$ $$| $$$$$ | $$$$$$$/
| $$____/ | $$__ $$| $$ | $$| $$|_ $$| $$__ $$| $$__ $$| $$ $$$| $$| $$ $$$| $$| $$__/ | $$__ $$
| $$ | $$ \ $$| $$ | $$| $$ \ $$| $$ \ $$| $$ | $$| $$\ $ | $$| $$\ $ | $$| $$ | $$ \ $$
| $$ | $$ | $$| $$$$$$/| $$$$$$/| $$ | $$| $$ | $$| $$ \/ | $$| $$ \/ | $$| $$$$$$$$| $$ | $$
|__/ |__/ |__/ \______/ \______/ |__/ |__/|__/ |__/|__/ |__/|__/ |__/|________/|__/ |__/
*/
import java.io.*;
import java.util.*;
import java.math.*;
public class cf
{
// static class pair{
// long x;
// Long y;
// public pair(long x,long y){
// this.x=x;
// this.y=y;
// }
// }
static int dp[][];
static int solve(String s1,String s2,int n,int m){
if(n<=0 || m<=0)
return 0;
if(dp[n][m]!=-1)
return dp[n][m];
if(s1.charAt(n-1)==s2.charAt(m-1)){
return dp[n][m]=solve(s1,s2,n-1,m-1)+2;
}
else{
return dp[n][m]= Math.max(solve(s1,s2,n-1,m)-1,solve(s1,s2,n,m-1)-1);
}
}
public static void main(String args[]) throws IOException
{
Scanner sc=new Scanner(System.in);
String s=sc.next();
int n=s.length();
int i=0;
int j=s.length()-1;
boolean f=true;
int c=0;
while(i<=j){
if(s.charAt(i)!=s.charAt(j)){
f=false;
break;
}
i++;
j--;
}
if(f){
System.out.println("0");
}
else{
System.out.println("3");
System.out.println("R "+(n-1));
System.out.println("L "+n);
System.out.println("L 2");
}
}
}