Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1674 | Codeforces Round 786 (Div. 3) | FINISHED | False | 7200 | 85764263 | May 2, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 24082 ) | C | Infinite Replacement | PROGRAMMING | combinatorics implementation strings |
B'You are given a string s , consisting only of Latin letters 'a ', and a string t , consisting of lowercase Latin letters. In one move, you can replace any letter 'a ' in the string s with a string t . Note that after the replacement string s might contain letters other than 'a '. You can perform an arbitrary number of moves (including zero). How many different strings can you obtain? Print the number, or report that it is infinitely large. Two strings are considered different if they have different length, or they differ at some index. The first line contains a single integer q ( 1 <= q <= 10^4 ) -- the number of testcases. The first line of each testcase contains a non-empty string s , consisting only of Latin letters 'a '. The length of s doesn 't exceed 50 . The second line contains a non-empty string t , consisting of lowercase Latin letters. The length of t doesn 't exceed 50 . For each testcase, print the number of different strings s that can be obtained after an arbitrary amount of moves (including zero). If the number is infinitely large, print -1. Otherwise, print the number. In the first example, you can replace any letter 'a ' with the string "a", but that won 't change the string. So no matter how many moves you make, you can 't obtain a string other than the initial one. In the second example, you can replace the second letter 'a ' with "abc". String s becomes equal to "aabc". Then the second letter 'a ' again. String s becomes equal to "aabcbc". And so on, generating infinitely many different strings. In the third example, you can either leave string s as is, performing zero moves, or replace the only 'a ' with "b". String s becomes equal to "b", so you can 't perform more moves on it. '... |
102482 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
155765370 | Geraltszm | C | May 3, 2022, 1:18 p.m. | OK | Clang++17 Diagnostics | TESTS | 8 | 373 | 4198400 | ||
155765310 | BossWang | C | May 3, 2022, 1:17 p.m. | OK | Clang++17 Diagnostics | TESTS | 8 | 373 | 4198400 | ||
155815122 | akshat211103 | C | May 4, 2022, 5:50 a.m. | OK | GNU C11 | TESTS | 8 | 62 | 0 | ||
155760443 | piyalsana | C | May 3, 2022, 12:24 p.m. | OK | GNU C11 | TESTS | 8 | 62 | 0 | ||
155725648 | zsa.sauran | C | May 3, 2022, 5:34 a.m. | OK | GNU C11 | TESTS | 8 | 62 | 0 | ||
155753605 | Sempr | C | May 3, 2022, 11:11 a.m. | OK | GNU C11 | TESTS | 8 | 78 | 0 | ||
155773746 | float33 | C | May 3, 2022, 2:22 p.m. | OK | GNU C11 | TESTS | 8 | 78 | 0 | ||
155747514 | AC_Wong | C | May 3, 2022, 10:04 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155746866 | 4Coding | C | May 3, 2022, 9:57 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155808239 | 2021YM_HUNNU | C | May 4, 2022, 3:18 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155802268 | lfxxx | C | May 4, 2022, 12:11 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155791143 | liympanda | C | May 3, 2022, 6:38 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155774455 | AleksaMaster | C | May 3, 2022, 2:32 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155773543 | FNOIwyhao | C | May 3, 2022, 2:20 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155762857 | es611543 | C | May 3, 2022, 12:51 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155749886 | sg3332 | C | May 3, 2022, 10:31 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155815761 | __stick | C | May 4, 2022, 6:01 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 0 | ||
155779050 | YHSifat | C | May 3, 2022, 3:33 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155776724 | binge666 | C | May 3, 2022, 3:02 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155776439 | PineapplesOnPizza | C | May 3, 2022, 2:58 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155776301 | Dhliv | C | May 3, 2022, 2:56 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155775943 | ZANATY_ | C | May 3, 2022, 2:51 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155769940 | InfinityDream | C | May 3, 2022, 1:36 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155779237 | _Ellery | C | May 3, 2022, 3:35 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155808114 | TsReaper | C | May 4, 2022, 3:15 a.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155809902 | ElnuR_007 | C | May 4, 2022, 4:01 a.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155779143 | ran_away | C | May 3, 2022, 3:34 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 0 | ||
155800170 | Muhammed_Ahmed | C | May 3, 2022, 10:42 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155812161 | startrek4 | C | May 4, 2022, 4:57 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155810704 | mrbrown | C | May 4, 2022, 4:25 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155810678 | 2-qiym | C | May 4, 2022, 4:24 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155806851 | dfzgcj | C | May 4, 2022, 2:41 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155789694 | MeeroApproved | C | May 3, 2022, 6:13 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155788374 | pd_codes | C | May 3, 2022, 5:52 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155786435 | isheoran | C | May 3, 2022, 5:19 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155774579 | LouaiZahran | C | May 3, 2022, 2:33 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155771109 | subhadip8617 | C | May 3, 2022, 1:49 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 0 | ||
155761300 | lin_ac | C | May 3, 2022, 12:33 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 0 | 0 | ||
155770560 | DaNeK0201 | C | May 3, 2022, 1:43 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 0 | 0 | ||
155802095 | ZeyadWahid | C | May 4, 2022, 12:03 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155801935 | Hummus_ | C | May 3, 2022, 11:57 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155801367 | HashemGhanim | C | May 3, 2022, 11:31 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155800818 | defaultedplayer | C | May 3, 2022, 11:09 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155811839 | shekharh433 | C | May 4, 2022, 4:51 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155815839 | huomark1001 | C | May 4, 2022, 6:02 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155804461 | hayford08 | C | May 4, 2022, 1:33 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155804226 | I_Remember_Olya_ashmelev | C | May 4, 2022, 1:26 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 0 | ||
155742551 | Bu-Dong-Ming | C | May 3, 2022, 9:11 a.m. | OK | Go | TESTS | 8 | 62 | 1433600 | ||
155772677 | Sempr | C | May 3, 2022, 2:09 p.m. | OK | Go | TESTS | 8 | 62 | 2150400 | ||
155745182 | AM03_00 | C | May 3, 2022, 9:38 a.m. | OK | Go | TESTS | 8 | 77 | 1536000 | ||
155743837 | Bu-Dong-Ming | C | May 3, 2022, 9:24 a.m. | OK | Go | TESTS | 8 | 77 | 1536000 | ||
155815424 | parascoding | C | May 4, 2022, 5:55 a.m. | OK | Java 11 | TESTS | 8 | 170 | 0 | ||
155732630 | Yash9890 | C | May 3, 2022, 7:13 a.m. | OK | Java 11 | TESTS | 8 | 171 | 0 | ||
155788487 | Srikanth1777 | C | May 3, 2022, 5:54 p.m. | OK | Java 11 | TESTS | 8 | 171 | 0 | ||
155730017 | Satyaa | C | May 3, 2022, 6:41 a.m. | OK | Java 11 | TESTS | 8 | 171 | 0 | ||
155781711 | ayush__1411 | C | May 3, 2022, 4:08 p.m. | OK | Java 11 | TESTS | 8 | 186 | 0 | ||
155780687 | sharnit | C | May 3, 2022, 3:54 p.m. | OK | Java 11 | TESTS | 8 | 186 | 0 | ||
155763837 | zenilharia26 | C | May 3, 2022, 1:01 p.m. | OK | Java 11 | TESTS | 8 | 186 | 0 | ||
155737080 | kartheek542 | C | May 3, 2022, 8:11 a.m. | OK | Java 11 | TESTS | 8 | 186 | 0 | ||
155730804 | krishnagskr983 | C | May 3, 2022, 6:51 a.m. | OK | Java 11 | TESTS | 8 | 186 | 0 | ||
155780381 | gaju321 | C | May 3, 2022, 3:50 p.m. | OK | Java 11 | TESTS | 8 | 187 | 0 | ||
155796583 | Shemo | C | May 3, 2022, 8:46 p.m. | OK | Java 8 | TESTS | 8 | 93 | 0 | ||
155790209 | Yehia8 | C | May 3, 2022, 6:21 p.m. | OK | Java 8 | TESTS | 8 | 93 | 0 | ||
155756517 | Diaa12360 | C | May 3, 2022, 11:42 a.m. | OK | Java 8 | TESTS | 8 | 93 | 0 | ||
155754921 | suyash.211.sn | C | May 3, 2022, 11:25 a.m. | OK | Java 8 | TESTS | 8 | 108 | 0 | ||
155735320 | alibaba | C | May 3, 2022, 7:49 a.m. | OK | Java 8 | TESTS | 8 | 109 | 0 | ||
155808543 | amit_roy | C | May 4, 2022, 3:26 a.m. | OK | Java 8 | TESTS | 8 | 109 | 0 | ||
155751410 | Zicode | C | May 3, 2022, 10:49 a.m. | OK | Java 8 | TESTS | 8 | 109 | 0 | ||
155749060 | pandeyjii_11 | C | May 3, 2022, 10:22 a.m. | OK | Java 8 | TESTS | 8 | 109 | 0 | ||
155795422 | ShivamMehta | C | May 3, 2022, 8:15 p.m. | OK | Java 8 | TESTS | 8 | 109 | 5734400 | ||
155779981 | srvptk97 | C | May 3, 2022, 3:45 p.m. | OK | Java 8 | TESTS | 8 | 124 | 0 | ||
155759936 | cas_ZhangLing | C | May 3, 2022, 12:19 p.m. | OK | Kotlin 1.4 | TESTS | 8 | 202 | 0 | ||
155762449 | darkl0rd | C | May 3, 2022, 12:46 p.m. | OK | Kotlin 1.6 | TESTS | 8 | 233 | 0 | ||
155786207 | helicopterqqq | C | May 3, 2022, 5:16 p.m. | OK | Kotlin 1.6 | TESTS | 8 | 296 | 0 | ||
155770042 | BIvanV | C | May 3, 2022, 1:37 p.m. | OK | MS C++ 2017 | TESTS | 8 | 31 | 0 | ||
155769658 | megi_ | C | May 3, 2022, 1:32 p.m. | OK | MS C++ 2017 | TESTS | 8 | 31 | 0 | ||
155755389 | Jenshen | C | May 3, 2022, 11:30 a.m. | OK | MS C++ 2017 | TESTS | 8 | 46 | 0 | ||
155808488 | emailam | C | May 4, 2022, 3:25 a.m. | OK | MS C++ 2017 | TESTS | 8 | 46 | 0 | ||
155781206 | Jz_615 | C | May 3, 2022, 4:01 p.m. | OK | MS C++ 2017 | TESTS | 8 | 46 | 0 | ||
155765320 | Nastzats | C | May 3, 2022, 1:17 p.m. | OK | MS C++ 2017 | TESTS | 8 | 46 | 0 | ||
155735923 | CrashMaster | C | May 3, 2022, 7:57 a.m. | OK | MS C++ 2017 | TESTS | 8 | 46 | 0 | ||
155748627 | IQW | C | May 3, 2022, 10:17 a.m. | OK | MS C++ 2017 | TESTS | 8 | 61 | 0 | ||
155771925 | SofiBorisova | C | May 3, 2022, 2 p.m. | OK | MS C++ 2017 | TESTS | 8 | 61 | 0 | ||
155730473 | 1371597521 | C | May 3, 2022, 6:47 a.m. | OK | MS C++ 2017 | TESTS | 8 | 61 | 0 | ||
155737581 | tabibi | C | May 3, 2022, 8:16 a.m. | OK | .NET Core C# | TESTS | 8 | 140 | 2867200 | ||
155750613 | Adolf988 | C | May 3, 2022, 10:39 a.m. | OK | PyPy 3 | TESTS | 8 | 155 | 7065600 | ||
155813032 | abhijeet.panihar.cse20 | C | May 4, 2022, 5:12 a.m. | OK | PyPy 3 | TESTS | 8 | 156 | 6553600 | ||
155744387 | NAVI_Perfecto | C | May 3, 2022, 9:30 a.m. | OK | PyPy 3 | TESTS | 8 | 186 | 8601600 | ||
155729139 | random__person | C | May 3, 2022, 6:30 a.m. | OK | PyPy 3 | TESTS | 8 | 233 | 10240000 | ||
155785697 | saisanjith | C | May 3, 2022, 5:08 p.m. | OK | PyPy 3 | TESTS | 8 | 405 | 9523200 | ||
155783217 | dimasik06 | C | May 3, 2022, 4:30 p.m. | OK | PyPy 3 | TESTS | 8 | 420 | 9318400 | ||
155780411 | Sorcerer_Supreme | C | May 3, 2022, 3:50 p.m. | OK | PyPy 3 | TESTS | 8 | 436 | 9318400 | ||
155729155 | 6-_-9 | C | May 3, 2022, 6:30 a.m. | OK | PyPy 3 | TESTS | 8 | 452 | 10240000 | ||
155731573 | _N_0_0_B_ | C | May 3, 2022, 7 a.m. | OK | PyPy 3-64 | TESTS | 8 | 108 | 9625600 | ||
155796294 | nealzane | C | May 3, 2022, 8:39 p.m. | OK | PyPy 3-64 | TESTS | 8 | 109 | 9523200 | ||
155731212 | _N_0_0_B_ | C | May 3, 2022, 6:56 a.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 10342400 | ||
155765438 | ferz | C | May 3, 2022, 1:19 p.m. | OK | PyPy 3-64 | TESTS | 8 | 155 | 10444800 | ||
155742322 | atmur | C | May 3, 2022, 9:08 a.m. | OK | PyPy 3-64 | TESTS | 8 | 186 | 9932800 | ||
155733019 | abhaumik24 | C | May 3, 2022, 7:18 a.m. | OK | PyPy 3-64 | TESTS | 8 | 202 | 24678400 | ||
155814521 | the_emerging_coder | C | May 4, 2022, 5:39 a.m. | OK | PyPy 3-64 | TESTS | 8 | 358 | 11059200 | ||
155734711 | one_step_away | C | May 3, 2022, 7:40 a.m. | OK | PyPy 3-64 | TESTS | 8 | 358 | 11161600 | ||
155766064 | helmut_schmacker | C | May 3, 2022, 1:25 p.m. | OK | PyPy 3-64 | TESTS | 8 | 373 | 10547200 | ||
155780760 | WoodMachine | C | May 3, 2022, 3:56 p.m. | OK | PyPy 3-64 | TESTS | 8 | 373 | 10752000 | ||
155809849 | sahilbaid | C | May 4, 2022, 4 a.m. | OK | Python 3 | TESTS | 8 | 61 | 2048000 | ||
155724441 | cruim | C | May 3, 2022, 5:16 a.m. | OK | Python 3 | TESTS | 8 | 62 | 204800 | ||
155793163 | SiKey25 | C | May 3, 2022, 7:18 p.m. | OK | Python 3 | TESTS | 8 | 77 | 0 | ||
155792764 | Safwan221b | C | May 3, 2022, 7:09 p.m. | OK | Python 3 | TESTS | 8 | 78 | 1945600 | ||
155753799 | nutsjamie | C | May 3, 2022, 11:13 a.m. | OK | Python 3 | TESTS | 8 | 108 | 0 | ||
155732331 | Ophidiomaniac | C | May 3, 2022, 7:09 a.m. | OK | Python 3 | TESTS | 8 | 108 | 0 | ||
155735607 | sahilwahi | C | May 3, 2022, 7:52 a.m. | OK | Python 3 | TESTS | 8 | 109 | 0 | ||
155793159 | ferfong | C | May 3, 2022, 7:18 p.m. | OK | Python 3 | TESTS | 8 | 124 | 0 | ||
155794409 | Dimozavr | C | May 3, 2022, 7:48 p.m. | OK | Python 3 | TESTS | 8 | 124 | 0 | ||
155794168 | AdVeino | C | May 3, 2022, 7:42 p.m. | OK | Python 3 | TESTS | 8 | 124 | 0 |
Back to search problems