| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Another approach | andreyDagger | 1218. Episode N-th: The Jedi Tournament | 11 ноя 2021 22:35 | 1 |
I see many people solved this with graph algorithms, there is also greedy approach. Let's build graph: u->v, if jedi u is winning v. You are doing n iterations, on every iteration you check, can current Jedi win, or not. There is greedy strategy to check this. You can eliminating enemies in order of the number of incoming edges. The fewer edges lead to a Jedi, the earlier we should eliminate him Edited by author 11.11.2021 22:35 Edited by author 11.11.2021 22:35 Edited by author 11.11.2021 22:36 |
| 2 details not mentioned | itskiller | 1038. Проверка орфографии | 11 ноя 2021 17:58 | 2 |
there are 2 details which are not mentioned in the document. 1. number(0-9) is also the splitor of word, so word can only contained characters,a-z. such as A0B is 2 words. 2. Next line starts one new word, but not always starts one new sentence, such as this is one sentence, but is splited to 2 lines. |
| Why wrong Answer on TEst NumbEr 3??????? hel me please! | 6yxa/\bl | 1038. Проверка орфографии | 11 ноя 2021 17:48 | 2 |
|
| for WA#3 and WA#10 | tqti | 1038. Проверка орфографии | 10 ноя 2021 06:23 | 5 |
WA#3: new word start after '\n';(e.g. Abc'\n'new_word_here) WA#10 new word start after number; (e.g. 909090new_word_here) Thank you very much! It helps me a lot! I WA#3 because of this :D Thank you very much! It helps me a lot! I WA#3 because of this :D Thank you very much! It helps me a lot! I WA#3 because of this :D |
| AC in 5 rows | andreyDagger | 1053. Пиноккио | 8 ноя 2021 21:00 | 1 |
5 rows of code to solve this |
| A hint for those with WA15 | vnikulin | 1415. Мобильная жизнь | 8 ноя 2021 18:15 | 1 |
My issue was in EPS. When I changed it from 1e-5 to 1e-8 I got AC. Good luck! |
| To admins | andreyDagger | 1211. Круговая порука | 8 ноя 2021 18:05 | 2 |
I think this is very easy for 319 points of hardness, you only need to find cycle in directed graph Hardness is calculated automatically. Admins have nothing to do with it |
| help wa 25 / wa 6 | >>> | 1463. Радость населению! | 8 ноя 2021 16:59 | 1 |
|
| why time limit in 3rd? | Esteban Chandia | 1404. Легко взломать! | 8 ноя 2021 07:57 | 1 |
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char encrypted[100],desencriptado; int largo, resta; scanf("%s",encrypted); largo=strlen(encrypted); for(int j=0;j<largo;j++){ encrypted[j]-= 97; } encrypted[0]+=26; for(int i=1;i<largo;i++){ while(encrypted[i]<encrypted[i-1]){ encrypted[i]+=26; } } resta=5; for(int n=0;n<largo;n++){ desencriptado=((encrypted[n]-resta)%26)+97; printf("%c", desencriptado); resta=encrypted[n]; } return 0; } |
| it is a tree!!! | >>> | 1371. Грузоперевозки | 8 ноя 2021 01:37 | 1 |
|
| WA8 need help | Harshita Sharma | 1742. Тим-билдинг | 7 ноя 2021 17:49 | 1 |
I keep getting WA8 but I don't have any test cases that may go wrong. Please help. |
| Small hint | andreyDagger | 1155. Дуоны | 5 ноя 2021 18:12 | 1 |
Notice, that you can move duons alongside diagonal (A->F, A->H, G->E, ...) |
| Happy Ending Problem | yyll | 1538. Сторожевые башни | 5 ноя 2021 13:44 | 1 |
|
| test | >>> | 1900. Машина счастья | 4 ноя 2021 15:46 | 1 |
test >>> 4 ноя 2021 15:46 |
| What's the correct solution | Celebrate | 1895. Бифштексы на борту | 4 ноя 2021 08:16 | 1 |
My solution is O(n^3T),and how to solve it faster? |
| Hint | Takanashi Rikka | 2066. Простое выражение | 4 ноя 2021 06:32 | 3 |
Hint Takanashi Rikka 23 фев 2016 12:50 Answer is a - b - c or a - b * c Re: Hint Minos Skistonrak 4 апр 2018 18:50 Is this answer after sort? |
| Help! TLE19. What's wrong? | Maxim Afripov | 1510. Порядок | 3 ноя 2021 23:29 | 1 |
using System; using System.Collections.Generic; namespace Order { class Banknotes { public long value = 0; public int count = 0; public Banknotes(long value) { this.value = value; } } class Program { public static Banknotes FindMaxValue (List<Banknotes> list) { int _maxValue = list[0].count; Banknotes _maxBanknote = list[0]; for (int index = 1; index < list.Count; index++) { if (list[index].count > _maxValue) { _maxBanknote = list[index]; _maxValue = list[index].count; } } return _maxBanknote; } public static void Main (string[] args) { List<Banknotes> banknotes = new List<Banknotes>(); int length = Convert.ToInt32(Console.ReadLine()); if (length == 0) return; banknotes.Add(new Banknotes(Convert.ToInt64(Console.ReadLine()))); banknotes[0].count = 1; for (int iterable = 1; iterable < length; iterable++) { long number = Convert.ToInt64(Console.ReadLine()); for (int jterable = 0; jterable < banknotes.Count; jterable++) { // Console.WriteLine($"{number} is {numbers[jterable].value}?"); if (number == banknotes[jterable].value) { banknotes[jterable].count++; // Console.WriteLine("yes"); break; } else if (jterable + 1 == banknotes.Count) { // Console.WriteLine("no"); banknotes.Add(new Banknotes(number)); } } } Console.WriteLine(FindMaxValue(banknotes).value); } } } |
| Why WA1? | ivan.filippov201608@gmail.com | 1223. Chernobyl’ Eagle on a Roof | 3 ноя 2021 00:00 | 1 |
Why WA1? ivan.filippov201608@gmail.com 3 ноя 2021 00:00 pls give me some tests,i don't know,what's wrong with my code #include<iostream> #define endl '\n' #define ll long long # define ld long double using namespace std; ll d[1100][1100]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LOCAL freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif // LOCALfr int n,m; for (int i=1;i<=1000;i++) { for (int j=1;j<=1000;j++) { d[i][j] = d[i][j-1] + d[i - 1][j - 1] + 1; } } n=1;m=1; while (n && m) { cin>>n>>m; if (n &&m) { int l=1,r=m+1000,mi; while (l<r) { mi=(l+r)/2; if (d[n][mi]>=m) { r=mi; } else l=mi+1; } cout<<l<<endl; } } return 0; } Edited by author 03.11.2021 00:01 Edited by author 03.11.2021 00:01 Edited by author 03.11.2021 00:01 |
| Some tests | Nedyalko Borisov | 1432. Двойное счастье | 2 ноя 2021 07:27 | 1 |
Here are some tests that helped me figure out what was wrong with my program: 316496 out => 317559 317560 318533 out => 318659 318660 945999 out => 950509 950510 055099 out => 055109 055110 00510059 out => 00504999 00505000 00450010 out => 00460019 00460020 00504010 out => 00504999 00505000 0019 out => 4509 4510 00510059 out => 00510059 00510060 945999 out => 950509 950510 008359 out => 009449 009450 3000 out => 4509 4510 4509 out => 4509 4510 4099 out => 4509 4510 9999 out => No solution 373730020389 out => 373730021389 373730021390 373730030290 out => 373730031289 373730031290 373730030289 out => 373730031289 373730031290 Good luck! |
| C# | Maxim Afripov | 1601. АнтиКАПС | 2 ноя 2021 00:08 | 1 |
C# Maxim Afripov 2 ноя 2021 00:08 1) Input text 2) Compare each character with: letter punctuation 3) Output with changes using System; using System.Collections.Generic; namespace AntiCAPS { public class Program { public static void Main(string[] args) { bool _newSentence = true; string message = Console.In.ReadToEnd().ToLower(); List<char> punctuation = new List<char>(new char[] { '!', '.', '?' }); for (int iterable = 0; iterable < message.Length; iterable++) { if ((int)message[iterable] >= 97 && (int)message[iterable] <= 122) { if (_newSentence) { Console.Write(Char.ToUpper(message[iterable])); _newSentence = false; } else Console.Write(message[iterable]); } else if (punctuation.Contains(message[iterable])) { _newSentence = true; Console.Write(message[iterable]); } else Console.Write(message[iterable]); } } } } Edited by author 02.11.2021 00:10 |