| Show all threads Hide all threads Show all messages Hide all messages |
| cin/cout is possible; WA5 | ASK | 1890. Money out of Thin Air | 2 Jul 2016 08:50 | 2 |
use cin.sync_with_stdio(false) Btw, WA5 was due to int instead of int64_t why did i use scanf still wa? |
| What is test 3? | organmusic | 1058. Chocolate | 2 Jul 2016 02:15 | 1 |
All tests have published here passes. Test 3 gives WA persistently. What is it like? I fixed 4 digits after decimal point of a result (that is, for example: 3.0000) Does it matter? Edited by author 02.07.2016 02:19 Edited by author 02.07.2016 02:19 |
| Idea for linear solution :) | Punkrocker | 1058. Chocolate | 2 Jul 2016 01:53 | 4 |
Not very hard to prove, then the breakage-line must create EQUAL ANGLES with sides, connected by it. This idea immediately gives the O(N^3) algorithm. But it could be improved even to O(N). :) Edited by author 20.08.2008 20:22 It could be corners instead of sides for the following input. 6 0 0 2 1 4 0 4 4 2 3 0 4 to Erick Wilts CONVEX poligon |
| WA test #4 or #6. Here's the bug!! | Dang Quang Huy | 1078. Segments | 1 Jul 2016 20:08 | 1 |
test #4, if you sort the left nodes then before updating the DP[i], you should check whether their left nodes are coincide or not. e.g: 4 1 2 1 3 1 4 1 5 test #6: this test has n == 1, you just need to print 1 and 1 in the output. |
| runtime error java | Mostafa Tantawy | 1197. Lonesome Knight | 1 Jul 2016 10:10 | 1 |
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package test; import java.util.ArrayList; import java.util.Scanner; /** * * @author MMT */ public class P1197 {
public static void main(String[] args){ // declaration of variables Scanner in_number=new Scanner (System.in); Scanner in_string=new Scanner (System.in);
int n=0; ArrayList res=new ArrayList(); String s=" "; char c1=' '; int c2=0; int contr=0; n=in_number.nextInt();
if(n>0 && n<101){ for(int i=0;i<n;i++){
s=in_string.next();
c1=s.charAt(0); c2=Integer.parseInt(s.substring(1)); if((((char)c1+1) <'i') &&(((char)c1+1) >'`') && ((c2+2)<=8) && ((c2+2)>0) ) contr++; if((((char)c1-1) >'`') &&(((char)c1-1) <'i') && ( (c2+2)<=8) && ((c2+2)>0)) contr++; if( (((char)c1+1)<'i') &&(((char)c1+1) >'`') && ( (c2-2)>0) && ( (c2-2)<=8)) // right contr++; if((((char)c1-1) >'`') &&(((char)c1-1) <'i') && ( (c2-2)>0) && ( (c2-2)<=8) ) // right contr++; if((((char)c1+2) <'i') &&(((char)c1+2) >'`') && ( (c2+1)<=8) && ((c2+1)>0))// not checked contr++; if((((char)c1-2) >'`') &&(((char)c1-2) <'i') && ( (c2+1)<=8) && ((c2+1)>0)) // right contr++; if((((char)c1+2) <'i') &&(((char)c1+2) >'`') && ( (c2-1)>0) && ( (c2-1)<=8)) // not checked contr++; if((((char)c1-2) >'`') &&(((char)c1-2) <'i') && ( (c2-1)>0) && ( (c2-1)<=8)) // right contr++;
res.add(contr); contr=0; c1=' '; c2=0; s=" "; } for(int j=0;j<res.size();j++){ System.out.println(res.get(j));
} }/* char x = 'a'; x=(char) (x-1); System.out.println(x); */} } Edited by author 01.07.2016 10:11 |
| test solution | Brenomp | | 1 Jul 2016 00:44 | 1 |
|
| Statement | P_Nyagolov | 1077. Travelling Tours | 29 Jun 2016 19:02 | 1 |
|
| С# Solution | zak427 | 2023. Donald is a postman | 29 Jun 2016 14:31 | 1 |
using System; namespace Csharp_2023 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int num = 1; int sum = 0; for (int z = 1; z <= n; z++) { string str1 = Console.ReadLine(); for (int f = 1; f <= n; f++) { if (str1[0] == 'A' || str1[0] == 'P' || str1[0] == 'O' || str1[0] == 'R') { if (num == 1) sum += 0; else if (num == 2) sum += 1; else if (num == 3) sum += 2; num = 1; break; } else if (str1[0] == 'B' || str1[0] == 'M' || str1[0] == 'S') { if (num == 1) sum += 1; else if (num == 2) sum += 0; else if (num == 3) sum += 1; num = 2; break; } else if (str1[0] == 'D' || str1[0] == 'G' || str1[0] == 'J' || str1[0] == 'K' || str1[0] == 'T' || str1[0] == 'W') { if (num == 1) sum += 2; else if (num == 2) sum += 1; else if (num == 3) sum += 0; num = 3; break; } } } Console.WriteLine(sum); } } } |
| plz tell me why my answer is wrong | MichealChen | 1209. 1, 10, 100, 1000... | 29 Jun 2016 13:36 | 1 |
//i try to run the code passed, i seems it make the same answer as me //i don't know what's wrong accur,plz help me.Does there is any wrong in way i solve this problem? import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner ( System.in ); int a,temp;//count store time of test //find 1,1 is easy to find //1 is at (n+1)n/2 +1 int count=cin.nextInt(); for (int j=1; j<=count; j++) { a=cin.nextInt(); temp=(int) Math.floor(Math.sqrt(2*(j-1))); if((temp*(temp+1)/2+1)==j){ System.out.print("1 "); }else { System.out.print("0 "); } } } } |
| How to? | Jane Soboleva (SumNU) | 2087. Trains | 29 Jun 2016 06:17 | 1 |
How to? Jane Soboleva (SumNU) 29 Jun 2016 06:17 So like, i spent a few days thinking of a possible way to do this, and one of the ideas that hit me was finding the closest parent of two vertices in O(log n) like it's done in tasks 1329 or 1471; in a case of this task, we can quickly find a parent of previous train and current train — a particular turnout that we need to switch, ignoring a potentially huge number of turnouts before this one. We switch it, make a step forward, and then repeat the algo in a subtree. Or so i thought this ideally would be. I also use the array that has, for each vertex, the trainroute that was passing by through this vertex last time. More or less, because we can't mark them all anyway, because it won't differ from a brute force then and will lead to TL. Anyways, i have found a countertest for my program: 6 6 X-L.X.X.X.X ..|.|.|.|.| S-R-R-R-R-R ..|.|.|.|.| X-R.X.X.X.F ..........| X.X.X.X.X.F |.|.|.|.|.| L-L-L-L-L-R |.|.|.|.|.| X.X.X.X.X.X 5 1 1 4 2 6 3 3 6 5 4 1 3 5 4 3 For which, my bruteforce shows a correct answer 12 2 2 2 F 3 2 3 F 4 2 4 L 5 2 4 F 6 2 3 L 6 2 5 F 7 2 3 F 11 5 5 F 12 5 5 L 12 5 4 F 14 5 5 F 16 5 3 R , but my "quick" algo doesn't have the 14 5 5 F row. It'll take too much space explaining fully why this happens, but in short, on a certain subtree it sees the route that went through that spot a bit too much time ago, and falsely assumes that further turnouts are arranged for that route. Which is not fully true. (here's a final "last visitor" map if it can potentially explain it) 00 00 00 00 00 00 03 04 03 33 33 33 00 00 00 00 00 33 00 00 00 00 00 33 00 00 33 33 35 33 00 00 00 00 00 00 So that makes me wonder, if my idea is right overall (it looked pretty to me at first...) but just my implementation is bad, or is the idea itself is a no-go and i should try something entirely different? Though quite likely i'll just give up, i spent a bit too many days on this without good outcome... |
| No subject | Gulliput | 1005. Stone Pile | 29 Jun 2016 01:31 | 1 |
Edited by author 01.07.2016 01:40 Edited by author 01.07.2016 01:40 |
| Time limit update in problem 1269 Obscene Words Filter | Vladimir Yakovlev (USU) | 1269. Obscene Words Filter | 26 Jun 2016 22:33 | 1 |
The new time limit is 1.0 seconds (old - 0.5s). All submissions have been rejudged. The number of authors who has AC remain almost the same. |
| if k<=n-2 then no solution? | Felix_Mate | 1735. Theft of the Century | 26 Jun 2016 10:59 | 1 |
Edited by author 31.07.2017 12:48 |
| The Rust Programming Language was added | Vladimir Yakovlev (USU) | | 26 Jun 2016 04:36 | 1 |
|
| Don't use unsigned long long, use simple long long. (was WA7) | Raven | 1017. Staircases | 25 Jun 2016 18:37 | 2 |
Used unsigned long long. At result got WA7. Just clear unsigned everywhere and i got AC. Strange behavior. There was no negative numbers, it's really strange. i used unsigned but didn't get any wrong answer |
| WA 12 | BZz13 | 1208. Legendary Teams Contest | 23 Jun 2016 18:48 | 2 |
WA 12 BZz13 17 Jun 2016 19:10 5 1 2 a 4 b c 3 a b 5 c d 6 7 d answer 3 |
| AC with N*logN | Sandu Petrasco | 1005. Stone Pile | 23 Jun 2016 14:20 | 1 |
Use the generation of the subsets |
| Test Case 8 | Imran | 1414. Astronomical Database | 23 Jun 2016 08:55 | 1 |
Can someone tell me what's test case 8? With set, all testcases pass but with Trie, I am getting WA at testcase 8. |
| Объяснения по-русски | Felix_Mate | 1218. Episode N-th: The Jedi Tournament | 23 Jun 2016 06:31 | 3 |
Короче,у нас проходит некий турнир.Правила таковы: мы выбираем любых двух джедаев из оставшихся ,они между собой сражаются,из них по условию ровно один побеждает,проигравший исчезает с турнира. И так далее: снова выбираем двух джедаев,один остается,и т.д. По условию либо Джедай А сильнее Джедая Б либо наоборот. Сильнее значит не менее чем по двум параметрам один джедай выигрывает у другого(т.е. соответствующие значения строго больше). Нам нужно найти всех возможных победителей,т.е. тех,кто останется последним. Мы можем как угодно формировать расписание турнира,т.е. выбирать кто с кем из оставшихся будет драться. Победитель может провести всего 1 бой,а может 2,а может 3,... .Расписание мы САМИ формируем!!! У кого нет идей,советую узнать про алгоритм Тарьяна и граф конденсации. Edited by author 31.08.2015 22:18 За N*logN решается, есличо)) |
| some tests | FrostCode | 1612. Tram Forum | 22 Jun 2016 01:50 | 2 |
Input: trams trolleybuses trambus bus Output: Bus driver Input: tram tramtrolleybus bus Output: Tram driver Input: trams trolleybus trolleybus tram! tram. Output: Bus driver Input: bus bus tratrolleybus trolleybu tra. Output: Bus driver Input: trams trolleybuses trambus bus Output: Bus driver Input: tram tramtrolleybus bus Output: Tram driver Input: trams trolleybus trolleybus tram! tram. Output: Bus driver Input: bus bus tratrolleybus trolleybu tra. Output: Bus driver Thanks a lot... :) |