|
|
Общий форум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. 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 5 rows of code to solve this My issue was in EPS. When I changed it from 1e-5 to 1e-8 I got AC. Good luck! 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 #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; } I keep getting WA8 but I don't have any test cases that may go wrong. Please help. Notice, that you can move duons alongside diagonal (A->F, A->H, G->E, ...) My solution is O(n^3T),and how to solve it faster? Answer is a - b - c or a - b * c Is this answer after sort? 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); } } } 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 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! 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 N = input().split() res = int(N[0]) * int(N[1]) * int(N[2]) * 2 NVM... forgot to use print Edited by author 01.11.2021 23:13 |
|
|