id
stringlengths
2
6
java
stringlengths
48
5.92k
python
stringlengths
33
11.1k
T100
import java . io . * ; import java . util . * ; import java . math . * ; public class Main { static boolean debug = false ; static boolean debug2 = false ; public static void main ( String [ ] args ) throws java . io . IOException { debug = 1 <= args . length ; debug2 = 2 <= args . length ; BufferedReader in = new Buff...
X = input ( ) NEW_LINE s = input ( ) NEW_LINE result = " " . join ( [ c for c in s if c not in X ] ) NEW_LINE print ( result ) NEW_LINE
T101
import java . io . * ; import java . util . * ; import java . math . * ; public class Main { static boolean debug = false ; static boolean debug2 = false ; public static void main ( String [ ] args ) throws java . io . IOException { debug = 1 <= args . length ; debug2 = 2 <= args . length ; BufferedReader in = new Buff...
x , c = input ( ) , input ( ) NEW_LINE ans = " " NEW_LINE for i in range ( len ( c ) ) : NEW_LINE INDENT if c [ i ] != x : ans += c [ i ] NEW_LINE DEDENT print ( ans ) NEW_LINE
T102
import java . io . * ; import java . util . * ; import java . math . * ; public class Main { static boolean debug = false ; static boolean debug2 = false ; public static void main ( String [ ] args ) throws java . io . IOException { debug = 1 <= args . length ; debug2 = 2 <= args . length ; BufferedReader in = new Buff...
s = input ( ) ; print ( input ( ) . replace ( s , " " ) ) NEW_LINE
T103
import java . io . * ; import java . util . * ; import java . math . * ; public class Main { static boolean debug = false ; static boolean debug2 = false ; public static void main ( String [ ] args ) throws java . io . IOException { debug = 1 <= args . length ; debug2 = 2 <= args . length ; BufferedReader in = new Buff...
X = input ( ) NEW_LINE s = [ str ( _ ) for _ in input ( ) ] NEW_LINE Res = [ ] NEW_LINE for i in s : NEW_LINE INDENT if X == i : NEW_LINE INDENT continue NEW_LINE DEDENT else : NEW_LINE INDENT Res . append ( i ) NEW_LINE DEDENT DEDENT print ( " " . join ( Res ) ) NEW_LINE
T104
import java . io . * ; import java . util . * ; import java . math . * ; public class Main { static boolean debug = false ; static boolean debug2 = false ; public static void main ( String [ ] args ) throws java . io . IOException { debug = 1 <= args . length ; debug2 = 2 <= args . length ; BufferedReader in = new Buff...
import sys NEW_LINE import copy NEW_LINE input = sys . stdin . readline NEW_LINE c = input ( ) . rstrip ( ) NEW_LINE s = input ( ) . rstrip ( ) NEW_LINE print ( s . replace ( c , " " ) ) NEW_LINE
T105
import java . util . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; char x = sc . next ( ) . charAt ( 0 ) ; String s = sc . next ( ...
X = input ( ) NEW_LINE s = input ( ) NEW_LINE result = " " . join ( [ c for c in s if c not in X ] ) NEW_LINE print ( result ) NEW_LINE
T106
import java . util . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; char x = sc . next ( ) . charAt ( 0 ) ; String s = sc . next ( ...
x , c = input ( ) , input ( ) NEW_LINE ans = " " NEW_LINE for i in range ( len ( c ) ) : NEW_LINE INDENT if c [ i ] != x : ans += c [ i ] NEW_LINE DEDENT print ( ans ) NEW_LINE
T107
import java . util . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; char x = sc . next ( ) . charAt ( 0 ) ; String s = sc . next ( ...
s = input ( ) ; print ( input ( ) . replace ( s , " " ) ) NEW_LINE
T108
import java . util . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; char x = sc . next ( ) . charAt ( 0 ) ; String s = sc . next ( ...
X = input ( ) NEW_LINE s = [ str ( _ ) for _ in input ( ) ] NEW_LINE Res = [ ] NEW_LINE for i in s : NEW_LINE INDENT if X == i : NEW_LINE INDENT continue NEW_LINE DEDENT else : NEW_LINE INDENT Res . append ( i ) NEW_LINE DEDENT DEDENT print ( " " . join ( Res ) ) NEW_LINE
T109
import java . util . * ; import java . awt . * ; import java . awt . geom . * ; import static java . lang . System . * ; import static java . lang . Math . * ; public class Main { public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; char x = sc . next ( ) . charAt ( 0 ) ; String s = sc . next ( ...
import sys NEW_LINE import copy NEW_LINE input = sys . stdin . readline NEW_LINE c = input ( ) . rstrip ( ) NEW_LINE s = input ( ) . rstrip ( ) NEW_LINE print ( s . replace ( c , " " ) ) NEW_LINE
T110
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = " EQUAL " ; if ( a . length ( ) > b . length ( ) ) { System . out . println ( " GREATER " ) ; System . exit ( 0 ) ;...
a = int ( input ( ) ) NEW_LINE b = int ( input ( ) ) NEW_LINE print ( " GREATER " if a > b else " LESS " if a < b else " EQUAL " ) NEW_LINE
T111
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = " EQUAL " ; if ( a . length ( ) > b . length ( ) ) { System . out . println ( " GREATER " ) ; System . exit ( 0 ) ;...
import sys NEW_LINE ns = lambda : sys . stdin . readline ( ) . rstrip ( ) NEW_LINE ni = lambda : int ( ns ( ) ) NEW_LINE nm = lambda : map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE nl = lambda : list ( nm ( ) ) NEW_LINE a = list ( ns ( ) ) NEW_LINE b = list ( ns ( ) ) NEW_LINE if len ( a ) > len ( b ) :...
T112
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = " EQUAL " ; if ( a . length ( ) > b . length ( ) ) { System . out . println ( " GREATER " ) ; System . exit ( 0 ) ;...
a , b = map ( int , open ( 0 ) ) ; print ( [ ' ELQEUSASL ' [ a < b : : 2 ] , ' GREATER ' ] [ a > b ] ) NEW_LINE
T113
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = " EQUAL " ; if ( a . length ( ) > b . length ( ) ) { System . out . println ( " GREATER " ) ; System . exit ( 0 ) ;...
A , B = int ( input ( ) ) , int ( input ( ) ) NEW_LINE if A == B : NEW_LINE INDENT ans = ' EQUAL ' NEW_LINE DEDENT elif A < B : NEW_LINE INDENT ans = ' LESS ' NEW_LINE DEDENT else : NEW_LINE INDENT ans = ' GREATER ' NEW_LINE DEDENT print ( ans ) NEW_LINE
T114
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = " EQUAL " ; if ( a . length ( ) > b . length ( ) ) { System . out . println ( " GREATER " ) ; System . exit ( 0 ) ;...
from functools import reduce NEW_LINE import math NEW_LINE def main ( ) : NEW_LINE INDENT a = int ( input ( ) . rstrip ( ) ) NEW_LINE b = int ( input ( ) . rstrip ( ) ) NEW_LINE if a > b : NEW_LINE INDENT print ( ' GREATER ' ) NEW_LINE DEDENT elif b > a : NEW_LINE INDENT print ( ' LESS ' ) NEW_LINE DEDENT else : NEW_LI...
T115
import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . StringTokenizer ; public class Main { public static void ...
a = int ( input ( ) ) NEW_LINE b = int ( input ( ) ) NEW_LINE print ( " GREATER " if a > b else " LESS " if a < b else " EQUAL " ) NEW_LINE
T116
import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . StringTokenizer ; public class Main { public static void ...
import sys NEW_LINE ns = lambda : sys . stdin . readline ( ) . rstrip ( ) NEW_LINE ni = lambda : int ( ns ( ) ) NEW_LINE nm = lambda : map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE nl = lambda : list ( nm ( ) ) NEW_LINE a = list ( ns ( ) ) NEW_LINE b = list ( ns ( ) ) NEW_LINE if len ( a ) > len ( b ) :...
T117
import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . StringTokenizer ; public class Main { public static void ...
a , b = map ( int , open ( 0 ) ) ; print ( [ ' ELQEUSASL ' [ a < b : : 2 ] , ' GREATER ' ] [ a > b ] ) NEW_LINE
T118
import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . StringTokenizer ; public class Main { public static void ...
A , B = int ( input ( ) ) , int ( input ( ) ) NEW_LINE if A == B : NEW_LINE INDENT ans = ' EQUAL ' NEW_LINE DEDENT elif A < B : NEW_LINE INDENT ans = ' LESS ' NEW_LINE DEDENT else : NEW_LINE INDENT ans = ' GREATER ' NEW_LINE DEDENT print ( ans ) NEW_LINE
T119
import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . StringTokenizer ; public class Main { public static void ...
from functools import reduce NEW_LINE import math NEW_LINE def main ( ) : NEW_LINE INDENT a = int ( input ( ) . rstrip ( ) ) NEW_LINE b = int ( input ( ) . rstrip ( ) ) NEW_LINE if a > b : NEW_LINE INDENT print ( ' GREATER ' ) NEW_LINE DEDENT elif b > a : NEW_LINE INDENT print ( ' LESS ' ) NEW_LINE DEDENT else : NEW_LI...
T120
import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; ...
a = int ( input ( ) ) NEW_LINE b = int ( input ( ) ) NEW_LINE print ( " GREATER " if a > b else " LESS " if a < b else " EQUAL " ) NEW_LINE
T121
import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; ...
import sys NEW_LINE ns = lambda : sys . stdin . readline ( ) . rstrip ( ) NEW_LINE ni = lambda : int ( ns ( ) ) NEW_LINE nm = lambda : map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE nl = lambda : list ( nm ( ) ) NEW_LINE a = list ( ns ( ) ) NEW_LINE b = list ( ns ( ) ) NEW_LINE if len ( a ) > len ( b ) :...
T122
import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; ...
a , b = map ( int , open ( 0 ) ) ; print ( [ ' ELQEUSASL ' [ a < b : : 2 ] , ' GREATER ' ] [ a > b ] ) NEW_LINE
T123
import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; ...
A , B = int ( input ( ) ) , int ( input ( ) ) NEW_LINE if A == B : NEW_LINE INDENT ans = ' EQUAL ' NEW_LINE DEDENT elif A < B : NEW_LINE INDENT ans = ' LESS ' NEW_LINE DEDENT else : NEW_LINE INDENT ans = ' GREATER ' NEW_LINE DEDENT print ( ans ) NEW_LINE
T124
import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; ...
from functools import reduce NEW_LINE import math NEW_LINE def main ( ) : NEW_LINE INDENT a = int ( input ( ) . rstrip ( ) ) NEW_LINE b = int ( input ( ) . rstrip ( ) ) NEW_LINE if a > b : NEW_LINE INDENT print ( ' GREATER ' ) NEW_LINE DEDENT elif b > a : NEW_LINE INDENT print ( ' LESS ' ) NEW_LINE DEDENT else : NEW_LI...
T125
import java . math . BigInteger ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ; if ( comp < 0...
a = int ( input ( ) ) NEW_LINE b = int ( input ( ) ) NEW_LINE print ( " GREATER " if a > b else " LESS " if a < b else " EQUAL " ) NEW_LINE
T126
import java . math . BigInteger ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ; if ( comp < 0...
import sys NEW_LINE ns = lambda : sys . stdin . readline ( ) . rstrip ( ) NEW_LINE ni = lambda : int ( ns ( ) ) NEW_LINE nm = lambda : map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE nl = lambda : list ( nm ( ) ) NEW_LINE a = list ( ns ( ) ) NEW_LINE b = list ( ns ( ) ) NEW_LINE if len ( a ) > len ( b ) :...
T127
import java . math . BigInteger ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ; if ( comp < 0...
a , b = map ( int , open ( 0 ) ) ; print ( [ ' ELQEUSASL ' [ a < b : : 2 ] , ' GREATER ' ] [ a > b ] ) NEW_LINE
T128
import java . math . BigInteger ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ; if ( comp < 0...
A , B = int ( input ( ) ) , int ( input ( ) ) NEW_LINE if A == B : NEW_LINE INDENT ans = ' EQUAL ' NEW_LINE DEDENT elif A < B : NEW_LINE INDENT ans = ' LESS ' NEW_LINE DEDENT else : NEW_LINE INDENT ans = ' GREATER ' NEW_LINE DEDENT print ( ans ) NEW_LINE
T129
import java . math . BigInteger ; import java . util . Scanner ; public class Main { private static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ; if ( comp < 0...
from functools import reduce NEW_LINE import math NEW_LINE def main ( ) : NEW_LINE INDENT a = int ( input ( ) . rstrip ( ) ) NEW_LINE b = int ( input ( ) . rstrip ( ) ) NEW_LINE if a > b : NEW_LINE INDENT print ( ' GREATER ' ) NEW_LINE DEDENT elif b > a : NEW_LINE INDENT print ( ' LESS ' ) NEW_LINE DEDENT else : NEW_LI...
T130
import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String ans ; int la = a . length ( ) ; int lb = b . length ( ) ; if ( la > lb ) { ans = " GREATER " ; } else if ( la ...
a = int ( input ( ) ) NEW_LINE b = int ( input ( ) ) NEW_LINE print ( " GREATER " if a > b else " LESS " if a < b else " EQUAL " ) NEW_LINE
T131
import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String ans ; int la = a . length ( ) ; int lb = b . length ( ) ; if ( la > lb ) { ans = " GREATER " ; } else if ( la ...
import sys NEW_LINE ns = lambda : sys . stdin . readline ( ) . rstrip ( ) NEW_LINE ni = lambda : int ( ns ( ) ) NEW_LINE nm = lambda : map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE nl = lambda : list ( nm ( ) ) NEW_LINE a = list ( ns ( ) ) NEW_LINE b = list ( ns ( ) ) NEW_LINE if len ( a ) > len ( b ) :...
T132
import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String ans ; int la = a . length ( ) ; int lb = b . length ( ) ; if ( la > lb ) { ans = " GREATER " ; } else if ( la ...
a , b = map ( int , open ( 0 ) ) ; print ( [ ' ELQEUSASL ' [ a < b : : 2 ] , ' GREATER ' ] [ a > b ] ) NEW_LINE
T133
import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String ans ; int la = a . length ( ) ; int lb = b . length ( ) ; if ( la > lb ) { ans = " GREATER " ; } else if ( la ...
A , B = int ( input ( ) ) , int ( input ( ) ) NEW_LINE if A == B : NEW_LINE INDENT ans = ' EQUAL ' NEW_LINE DEDENT elif A < B : NEW_LINE INDENT ans = ' LESS ' NEW_LINE DEDENT else : NEW_LINE INDENT ans = ' GREATER ' NEW_LINE DEDENT print ( ans ) NEW_LINE
T134
import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String ans ; int la = a . length ( ) ; int lb = b . length ( ) ; if ( la > lb ) { ans = " GREATER " ; } else if ( la ...
from functools import reduce NEW_LINE import math NEW_LINE def main ( ) : NEW_LINE INDENT a = int ( input ( ) . rstrip ( ) ) NEW_LINE b = int ( input ( ) . rstrip ( ) ) NEW_LINE if a > b : NEW_LINE INDENT print ( ' GREATER ' ) NEW_LINE DEDENT elif b > a : NEW_LINE INDENT print ( ' LESS ' ) NEW_LINE DEDENT else : NEW_LI...
T135
import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String a [ ] = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } Set < String > set ...
N = int ( input ( ) ) NEW_LINE a = list ( input ( ) . split ( ) ) NEW_LINE if ( " Y " in a ) : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT
T136
import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String a [ ] = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } Set < String > set ...
input ( ) ; print ( ' TFhoruere ' [ ' Y ' in input ( ) : : 2 ] ) NEW_LINE
T137
import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String a [ ] = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } Set < String > set ...
n = int ( input ( ) ) NEW_LINE arr = list ( map ( str , input ( ) . split ( ) ) ) NEW_LINE count = 0 NEW_LINE if arr . count ( ' P ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' Y ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' W ' ) != 0 : NEW_LINE INDENT count += 1 N...
T138
import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String a [ ] = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } Set < String > set ...
N = input ( ) NEW_LINE S = list ( set ( list ( input ( ) . split ( ) ) ) ) NEW_LINE ans = len ( S ) NEW_LINE if ( ans == 3 ) : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT
T139
import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String a [ ] = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } Set < String > set ...
n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE print ( ' Four ' if ' Y ' in s else ' Three ' ) NEW_LINE
T140
import java . io . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; stdin . readLine ( ) ; long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " ▁ " ) ) . s...
N = int ( input ( ) ) NEW_LINE a = list ( input ( ) . split ( ) ) NEW_LINE if ( " Y " in a ) : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT
T141
import java . io . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; stdin . readLine ( ) ; long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " ▁ " ) ) . s...
input ( ) ; print ( ' TFhoruere ' [ ' Y ' in input ( ) : : 2 ] ) NEW_LINE
T142
import java . io . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; stdin . readLine ( ) ; long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " ▁ " ) ) . s...
n = int ( input ( ) ) NEW_LINE arr = list ( map ( str , input ( ) . split ( ) ) ) NEW_LINE count = 0 NEW_LINE if arr . count ( ' P ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' Y ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' W ' ) != 0 : NEW_LINE INDENT count += 1 N...
T143
import java . io . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; stdin . readLine ( ) ; long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " ▁ " ) ) . s...
N = input ( ) NEW_LINE S = list ( set ( list ( input ( ) . split ( ) ) ) ) NEW_LINE ans = len ( S ) NEW_LINE if ( ans == 3 ) : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT
T144
import java . io . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; stdin . readLine ( ) ; long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " ▁ " ) ) . s...
n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE print ( ' Four ' if ' Y ' in s else ' Three ' ) NEW_LINE
T145
import java . util . * ; import static java . lang . System . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { boolean P = false ; boolean W = false ; boolean G = false ; boolean Y = false ; int n = sc . nextInt ( ) ; String s ; for ( int i = 0 ; i ...
N = int ( input ( ) ) NEW_LINE a = list ( input ( ) . split ( ) ) NEW_LINE if ( " Y " in a ) : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT
T146
import java . util . * ; import static java . lang . System . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { boolean P = false ; boolean W = false ; boolean G = false ; boolean Y = false ; int n = sc . nextInt ( ) ; String s ; for ( int i = 0 ; i ...
input ( ) ; print ( ' TFhoruere ' [ ' Y ' in input ( ) : : 2 ] ) NEW_LINE
T147
import java . util . * ; import static java . lang . System . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { boolean P = false ; boolean W = false ; boolean G = false ; boolean Y = false ; int n = sc . nextInt ( ) ; String s ; for ( int i = 0 ; i ...
n = int ( input ( ) ) NEW_LINE arr = list ( map ( str , input ( ) . split ( ) ) ) NEW_LINE count = 0 NEW_LINE if arr . count ( ' P ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' Y ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' W ' ) != 0 : NEW_LINE INDENT count += 1 N...
T148
import java . util . * ; import static java . lang . System . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { boolean P = false ; boolean W = false ; boolean G = false ; boolean Y = false ; int n = sc . nextInt ( ) ; String s ; for ( int i = 0 ; i ...
N = input ( ) NEW_LINE S = list ( set ( list ( input ( ) . split ( ) ) ) ) NEW_LINE ans = len ( S ) NEW_LINE if ( ans == 3 ) : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT
T149
import java . util . * ; import static java . lang . System . * ; public class Main { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { boolean P = false ; boolean W = false ; boolean G = false ; boolean Y = false ; int n = sc . nextInt ( ) ; String s ; for ( int i = 0 ; i ...
n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE print ( ' Four ' if ' Y ' in s else ' Three ' ) NEW_LINE
T150
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; String ans = " Three " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = reader . next ( ) . charAt ( 0 ) ; if ( ch == ' Y ' ) { ans = " Four " ; } ...
N = int ( input ( ) ) NEW_LINE a = list ( input ( ) . split ( ) ) NEW_LINE if ( " Y " in a ) : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT
T151
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; String ans = " Three " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = reader . next ( ) . charAt ( 0 ) ; if ( ch == ' Y ' ) { ans = " Four " ; } ...
input ( ) ; print ( ' TFhoruere ' [ ' Y ' in input ( ) : : 2 ] ) NEW_LINE
T152
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; String ans = " Three " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = reader . next ( ) . charAt ( 0 ) ; if ( ch == ' Y ' ) { ans = " Four " ; } ...
n = int ( input ( ) ) NEW_LINE arr = list ( map ( str , input ( ) . split ( ) ) ) NEW_LINE count = 0 NEW_LINE if arr . count ( ' P ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' Y ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' W ' ) != 0 : NEW_LINE INDENT count += 1 N...
T153
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; String ans = " Three " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = reader . next ( ) . charAt ( 0 ) ; if ( ch == ' Y ' ) { ans = " Four " ; } ...
N = input ( ) NEW_LINE S = list ( set ( list ( input ( ) . split ( ) ) ) ) NEW_LINE ans = len ( S ) NEW_LINE if ( ans == 3 ) : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT
T154
import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; String ans = " Three " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = reader . next ( ) . charAt ( 0 ) ; if ( ch == ' Y ' ) { ans = " Four " ; } ...
n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE print ( ' Four ' if ' Y ' in s else ' Three ' ) NEW_LINE
T155
import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . ...
N = int ( input ( ) ) NEW_LINE a = list ( input ( ) . split ( ) ) NEW_LINE if ( " Y " in a ) : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT
T156
import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . ...
input ( ) ; print ( ' TFhoruere ' [ ' Y ' in input ( ) : : 2 ] ) NEW_LINE
T157
import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . ...
n = int ( input ( ) ) NEW_LINE arr = list ( map ( str , input ( ) . split ( ) ) ) NEW_LINE count = 0 NEW_LINE if arr . count ( ' P ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' Y ' ) != 0 : NEW_LINE INDENT count += 1 NEW_LINE DEDENT if arr . count ( ' W ' ) != 0 : NEW_LINE INDENT count += 1 N...
T158
import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . ...
N = input ( ) NEW_LINE S = list ( set ( list ( input ( ) . split ( ) ) ) ) NEW_LINE ans = len ( S ) NEW_LINE if ( ans == 3 ) : NEW_LINE INDENT print ( " Three " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Four " ) NEW_LINE DEDENT
T159
import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . ...
n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE print ( ' Four ' if ' Y ' in s else ' Three ' ) NEW_LINE
T160
import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; int [ ] sum = new int [ n + 1 ] ; long ans = 0 ; sum [ 0 ] = 0 ; map . put ( 0 , 1 ) ; fo...
from itertools import accumulate as ac NEW_LINE from collections import Counter as c NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = 0 NEW_LINE for i in c ( [ i % m for i in [ 0 ] + list ( ac ( list ( map ( int , input ( ) . split ( ) ) ) ) ) ] ) . values ( ) : NEW_LINE INDENT a += i * ( i - 1 ) // 2 ...
T161
import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; int [ ] sum = new int [ n + 1 ] ; long ans = 0 ; sum [ 0 ] = 0 ; map . put ( 0 , 1 ) ; fo...
import sys NEW_LINE import heapq NEW_LINE input = sys . stdin . readline NEW_LINE N , M = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE SUM = [ 0 ] NEW_LINE mp = { } NEW_LINE res = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE INDENT SUM . append ( ...
T162
import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; int [ ] sum = new int [ n + 1 ] ; long ans = 0 ; sum [ 0 ] = 0 ; map . put ( 0 , 1 ) ; fo...
import sys NEW_LINE import itertools NEW_LINE import collections NEW_LINE import functools NEW_LINE import math NEW_LINE from queue import Queue NEW_LINE INF = float ( " inf " ) NEW_LINE from operator import mul NEW_LINE from functools import reduce NEW_LINE def cmb ( n , r ) : NEW_LINE INDENT r = min ( n - r , r ) NEW...
T163
import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; int [ ] sum = new int [ n + 1 ] ; long ans = 0 ; sum [ 0 ] = 0 ; map . put ( 0 , 1 ) ; fo...
def main ( ) : NEW_LINE INDENT N , M = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE A = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE B = [ 0 ] * ( N + 1 ) NEW_LINE B [ 0 ] = 0 NEW_LINE d = { } NEW_LINE accum = 0 NEW_LINE for i in range ( N + 1 ) : NEW_LINE INDENT B [ i ] = accum NEW_LINE if i != N : N...
T164
import java . util . * ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; int [ ] sum = new int [ n + 1 ] ; long ans = 0 ; sum [ 0 ] = 0 ; map . put ( 0 , 1 ) ; fo...
def d_candy_distribution ( N , M , A ) : NEW_LINE INDENT import itertools NEW_LINE import collections NEW_LINE remainders = collections . defaultdict ( int ) NEW_LINE for t in [ 0 ] + list ( itertools . accumulate ( A ) ) : NEW_LINE INDENT remainders [ t % M ] += 1 NEW_LINE DEDENT return sum ( [ v * ( v - 1 ) // 2 for ...
T165
import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } lon...
from itertools import accumulate as ac NEW_LINE from collections import Counter as c NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = 0 NEW_LINE for i in c ( [ i % m for i in [ 0 ] + list ( ac ( list ( map ( int , input ( ) . split ( ) ) ) ) ) ] ) . values ( ) : NEW_LINE INDENT a += i * ( i - 1 ) // 2 ...
T166
import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } lon...
import sys NEW_LINE import heapq NEW_LINE input = sys . stdin . readline NEW_LINE N , M = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE SUM = [ 0 ] NEW_LINE mp = { } NEW_LINE res = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE INDENT SUM . append ( ...
T167
import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } lon...
import sys NEW_LINE import itertools NEW_LINE import collections NEW_LINE import functools NEW_LINE import math NEW_LINE from queue import Queue NEW_LINE INF = float ( " inf " ) NEW_LINE from operator import mul NEW_LINE from functools import reduce NEW_LINE def cmb ( n , r ) : NEW_LINE INDENT r = min ( n - r , r ) NEW...
T168
import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } lon...
def main ( ) : NEW_LINE INDENT N , M = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE A = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE B = [ 0 ] * ( N + 1 ) NEW_LINE B [ 0 ] = 0 NEW_LINE d = { } NEW_LINE accum = 0 NEW_LINE for i in range ( N + 1 ) : NEW_LINE INDENT B [ i ] = accum NEW_LINE if i != N : N...
T169
import java . util . HashMap ; import java . util . Scanner ; class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } lon...
def d_candy_distribution ( N , M , A ) : NEW_LINE INDENT import itertools NEW_LINE import collections NEW_LINE remainders = collections . defaultdict ( int ) NEW_LINE for t in [ 0 ] + list ( itertools . accumulate ( A ) ) : NEW_LINE INDENT remainders [ t % M ] += 1 NEW_LINE DEDENT return sum ( [ v * ( v - 1 ) // 2 for ...
T170
import java . util . * ; import java . io . * ; class Main { public static void main ( String ... args ) { int N = IN . nextInt ( ) ; int M = IN . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = IN . nextInt ( ) ; } HashMap < Integer , Integer > B = new HashMap < > ( ) ; B . put (...
from itertools import accumulate as ac NEW_LINE from collections import Counter as c NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = 0 NEW_LINE for i in c ( [ i % m for i in [ 0 ] + list ( ac ( list ( map ( int , input ( ) . split ( ) ) ) ) ) ] ) . values ( ) : NEW_LINE INDENT a += i * ( i - 1 ) // 2 ...
T171
import java . util . * ; import java . io . * ; class Main { public static void main ( String ... args ) { int N = IN . nextInt ( ) ; int M = IN . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = IN . nextInt ( ) ; } HashMap < Integer , Integer > B = new HashMap < > ( ) ; B . put (...
import sys NEW_LINE import heapq NEW_LINE input = sys . stdin . readline NEW_LINE N , M = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE SUM = [ 0 ] NEW_LINE mp = { } NEW_LINE res = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE INDENT SUM . append ( ...
T172
import java . util . * ; import java . io . * ; class Main { public static void main ( String ... args ) { int N = IN . nextInt ( ) ; int M = IN . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = IN . nextInt ( ) ; } HashMap < Integer , Integer > B = new HashMap < > ( ) ; B . put (...
import sys NEW_LINE import itertools NEW_LINE import collections NEW_LINE import functools NEW_LINE import math NEW_LINE from queue import Queue NEW_LINE INF = float ( " inf " ) NEW_LINE from operator import mul NEW_LINE from functools import reduce NEW_LINE def cmb ( n , r ) : NEW_LINE INDENT r = min ( n - r , r ) NEW...
T173
import java . util . * ; import java . io . * ; class Main { public static void main ( String ... args ) { int N = IN . nextInt ( ) ; int M = IN . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = IN . nextInt ( ) ; } HashMap < Integer , Integer > B = new HashMap < > ( ) ; B . put (...
def main ( ) : NEW_LINE INDENT N , M = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE A = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE B = [ 0 ] * ( N + 1 ) NEW_LINE B [ 0 ] = 0 NEW_LINE d = { } NEW_LINE accum = 0 NEW_LINE for i in range ( N + 1 ) : NEW_LINE INDENT B [ i ] = accum NEW_LINE if i != N : N...
T174
import java . util . * ; import java . io . * ; class Main { public static void main ( String ... args ) { int N = IN . nextInt ( ) ; int M = IN . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = IN . nextInt ( ) ; } HashMap < Integer , Integer > B = new HashMap < > ( ) ; B . put (...
def d_candy_distribution ( N , M , A ) : NEW_LINE INDENT import itertools NEW_LINE import collections NEW_LINE remainders = collections . defaultdict ( int ) NEW_LINE for t in [ 0 ] + list ( itertools . accumulate ( A ) ) : NEW_LINE INDENT remainders [ t % M ] += 1 NEW_LINE DEDENT return sum ( [ v * ( v - 1 ) // 2 for ...
T175
import java . util . Scanner ; import java . util . HashMap ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long [ ] a = new long [ n ] ; HashMap < Long , Integer > map = new HashMap < > ( ) ; long ans...
from itertools import accumulate as ac NEW_LINE from collections import Counter as c NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = 0 NEW_LINE for i in c ( [ i % m for i in [ 0 ] + list ( ac ( list ( map ( int , input ( ) . split ( ) ) ) ) ) ] ) . values ( ) : NEW_LINE INDENT a += i * ( i - 1 ) // 2 ...
T176
import java . util . Scanner ; import java . util . HashMap ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long [ ] a = new long [ n ] ; HashMap < Long , Integer > map = new HashMap < > ( ) ; long ans...
import sys NEW_LINE import heapq NEW_LINE input = sys . stdin . readline NEW_LINE N , M = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE SUM = [ 0 ] NEW_LINE mp = { } NEW_LINE res = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE INDENT SUM . append ( ...
T177
import java . util . Scanner ; import java . util . HashMap ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long [ ] a = new long [ n ] ; HashMap < Long , Integer > map = new HashMap < > ( ) ; long ans...
import sys NEW_LINE import itertools NEW_LINE import collections NEW_LINE import functools NEW_LINE import math NEW_LINE from queue import Queue NEW_LINE INF = float ( " inf " ) NEW_LINE from operator import mul NEW_LINE from functools import reduce NEW_LINE def cmb ( n , r ) : NEW_LINE INDENT r = min ( n - r , r ) NEW...
T178
import java . util . Scanner ; import java . util . HashMap ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long [ ] a = new long [ n ] ; HashMap < Long , Integer > map = new HashMap < > ( ) ; long ans...
def main ( ) : NEW_LINE INDENT N , M = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE A = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE B = [ 0 ] * ( N + 1 ) NEW_LINE B [ 0 ] = 0 NEW_LINE d = { } NEW_LINE accum = 0 NEW_LINE for i in range ( N + 1 ) : NEW_LINE INDENT B [ i ] = accum NEW_LINE if i != N : N...
T179
import java . util . Scanner ; import java . util . HashMap ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long [ ] a = new long [ n ] ; HashMap < Long , Integer > map = new HashMap < > ( ) ; long ans...
def d_candy_distribution ( N , M , A ) : NEW_LINE INDENT import itertools NEW_LINE import collections NEW_LINE remainders = collections . defaultdict ( int ) NEW_LINE for t in [ 0 ] + list ( itertools . accumulate ( A ) ) : NEW_LINE INDENT remainders [ t % M ] += 1 NEW_LINE DEDENT return sum ( [ v * ( v - 1 ) // 2 for ...
T180
import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; long sum [ ] = new l...
from itertools import accumulate as ac NEW_LINE from collections import Counter as c NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = 0 NEW_LINE for i in c ( [ i % m for i in [ 0 ] + list ( ac ( list ( map ( int , input ( ) . split ( ) ) ) ) ) ] ) . values ( ) : NEW_LINE INDENT a += i * ( i - 1 ) // 2 ...
T181
import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; long sum [ ] = new l...
import sys NEW_LINE import heapq NEW_LINE input = sys . stdin . readline NEW_LINE N , M = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE SUM = [ 0 ] NEW_LINE mp = { } NEW_LINE res = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE INDENT SUM . append ( ...
T182
import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; long sum [ ] = new l...
import sys NEW_LINE import itertools NEW_LINE import collections NEW_LINE import functools NEW_LINE import math NEW_LINE from queue import Queue NEW_LINE INF = float ( " inf " ) NEW_LINE from operator import mul NEW_LINE from functools import reduce NEW_LINE def cmb ( n , r ) : NEW_LINE INDENT r = min ( n - r , r ) NEW...
T183
import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; long sum [ ] = new l...
def main ( ) : NEW_LINE INDENT N , M = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE A = [ int ( n ) for n in input ( ) . split ( ) ] NEW_LINE B = [ 0 ] * ( N + 1 ) NEW_LINE B [ 0 ] = 0 NEW_LINE d = { } NEW_LINE accum = 0 NEW_LINE for i in range ( N + 1 ) : NEW_LINE INDENT B [ i ] = accum NEW_LINE if i != N : N...
T184
import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; long sum [ ] = new l...
def d_candy_distribution ( N , M , A ) : NEW_LINE INDENT import itertools NEW_LINE import collections NEW_LINE remainders = collections . defaultdict ( int ) NEW_LINE for t in [ 0 ] + list ( itertools . accumulate ( A ) ) : NEW_LINE INDENT remainders [ t % M ] += 1 NEW_LINE DEDENT return sum ( [ v * ( v - 1 ) // 2 for ...
T185
import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int total = scanner . nextInt ( ) ; int sum = 0 ; for ( int ix = 1 ; ix <= total ; ix ++ ) { sum += ix ; } System . out . println ( sum ) ; } }
N = int ( input ( ) ) NEW_LINE print ( int ( ( 1 + N ) * N / 2 ) ) NEW_LINE
T186
import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int total = scanner . nextInt ( ) ; int sum = 0 ; for ( int ix = 1 ; ix <= total ; ix ++ ) { sum += ix ; } System . out . println ( sum ) ; } }
def children_and_candies ( N : int ) -> int : NEW_LINE INDENT return N * ( N + 1 ) // 2 NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = int ( input ( ) ) NEW_LINE ans = children_and_candies ( N ) NEW_LINE print ( ans ) NEW_LINE DEDENT
T187
import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int total = scanner . nextInt ( ) ; int sum = 0 ; for ( int ix = 1 ; ix <= total ; ix ++ ) { sum += ix ; } System . out . println ( sum ) ; } }
from sys import stdin NEW_LINE n = int ( stdin . readline ( ) . rstrip ( ) ) NEW_LINE total = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT total += i NEW_LINE DEDENT print ( total ) NEW_LINE
T188
import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int total = scanner . nextInt ( ) ; int sum = 0 ; for ( int ix = 1 ; ix <= total ; ix ++ ) { sum += ix ; } System . out . println ( sum ) ; } }
print ( sum ( [ n for n in range ( 1 , int ( input ( ) ) + 1 ) ] ) ) NEW_LINE
T189
import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int total = scanner . nextInt ( ) ; int sum = 0 ; for ( int ix = 1 ; ix <= total ; ix ++ ) { sum += ix ; } System . out . println ( sum ) ; } }
n = input ( ) NEW_LINE n = int ( n ) NEW_LINE a = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT a = a + i NEW_LINE DEDENT print ( a ) NEW_LINE
T190
import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; int ame = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ame += i ; } System . out . println ( ame ) ; keyboard . clos...
N = int ( input ( ) ) NEW_LINE print ( int ( ( 1 + N ) * N / 2 ) ) NEW_LINE
T191
import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; int ame = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ame += i ; } System . out . println ( ame ) ; keyboard . clos...
def children_and_candies ( N : int ) -> int : NEW_LINE INDENT return N * ( N + 1 ) // 2 NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = int ( input ( ) ) NEW_LINE ans = children_and_candies ( N ) NEW_LINE print ( ans ) NEW_LINE DEDENT
T192
import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; int ame = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ame += i ; } System . out . println ( ame ) ; keyboard . clos...
from sys import stdin NEW_LINE n = int ( stdin . readline ( ) . rstrip ( ) ) NEW_LINE total = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT total += i NEW_LINE DEDENT print ( total ) NEW_LINE
T193
import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; int ame = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ame += i ; } System . out . println ( ame ) ; keyboard . clos...
print ( sum ( [ n for n in range ( 1 , int ( input ( ) ) + 1 ) ] ) ) NEW_LINE
T194
import java . util . Arrays ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; int ame = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ame += i ; } System . out . println ( ame ) ; keyboard . clos...
n = input ( ) NEW_LINE n = int ( n ) NEW_LINE a = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT a = a + i NEW_LINE DEDENT print ( a ) NEW_LINE
T195
import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N * ( 1 + N ) / 2 ) ; } }
N = int ( input ( ) ) NEW_LINE print ( int ( ( 1 + N ) * N / 2 ) ) NEW_LINE
T196
import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N * ( 1 + N ) / 2 ) ; } }
def children_and_candies ( N : int ) -> int : NEW_LINE INDENT return N * ( N + 1 ) // 2 NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = int ( input ( ) ) NEW_LINE ans = children_and_candies ( N ) NEW_LINE print ( ans ) NEW_LINE DEDENT
T197
import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N * ( 1 + N ) / 2 ) ; } }
from sys import stdin NEW_LINE n = int ( stdin . readline ( ) . rstrip ( ) ) NEW_LINE total = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT total += i NEW_LINE DEDENT print ( total ) NEW_LINE
T198
import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N * ( 1 + N ) / 2 ) ; } }
print ( sum ( [ n for n in range ( 1 , int ( input ( ) ) + 1 ) ] ) ) NEW_LINE
T199
import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N * ( 1 + N ) / 2 ) ; } }
n = input ( ) NEW_LINE n = int ( n ) NEW_LINE a = 0 NEW_LINE for i in range ( 1 , n + 1 ) : NEW_LINE INDENT a = a + i NEW_LINE DEDENT print ( a ) NEW_LINE