| Show all threads Hide all threads Show all messages Hide all messages |
| Omission in English statement | Otrebus | 1317. Hail | 24 Apr 2021 01:33 | 2 |
The limits on the number of hailstones k (1 ≤ k ≤ 100) is not specified. |
| wa 9 | Abid29 | 1254. Die Hard | 24 Apr 2021 00:07 | 1 |
wa 9 Abid29 24 Apr 2021 00:07 use sqrt(2.00) instead of 1.41421356 |
| If you WA30, try to use Visual Studio C++ | Hyperhydrochloric Acid | 1522. Factory | 23 Apr 2021 12:52 | 1 |
This will make your program accepted. I've tried it. |
| For WA11, WA13 | Mickkie | 1966. Cycling Roads | 21 Apr 2021 01:55 | 2 |
This probably helps 3 1 0 0 2 2 3 3 1 3 Ans: YES 3 1 0 5 2 5 3 5 1 2 Ans: NO |
| WA 5 | Solus | 1471. Distance in the Tree | 20 Apr 2021 23:09 | 2 |
WA 5 Solus 18 Apr 2021 20:51 What can it be?(tests or ideas, something pls) passes 3 0 1 1 1 2 0 1 1 2 ans: 0 but still WA Edited by author 20.04.2021 00:52 try 5 0 1 1 1 2 1 3 0 1 0 4 1 4 0 4 4 0 0 2 2 0 |
| Wrong answer on test 28 | Emanuelco07 | 1723. Sandro's Book | 20 Apr 2021 20:08 | 1 |
|
| if u have wa in test 3 | Abid29 | 1314. Chase in Subway | 20 Apr 2021 14:46 | 1 |
try this one input: 3 2 61 62 5 75 20 85 50 61 3 10 20 30 1 5 output: 5 |
| Can someone give me answer to this testcase? | Danica Porobic | 1314. Chase in Subway | 20 Apr 2021 14:07 | 7 |
4 3 75 85 20 2 61 62 5 75 20 85 50 61 3 10 20 30 3 30 20 85 Will answer include 75 or not? Why 75 does not fall into answer? Because no shortest route from 30 to 75 begins with 30,20,85 30->20->85->75 is one. Because no shortest route from 30 to 75 begins with 30,20,85 30->20->75 is shortest not your one Edited by author 20.04.2021 14:07 Edited by author 20.04.2021 14:07 |
| My solution in Python 3 took 0.062s and 220 KB. Can it be faster? | Dhruv Somani | 1545. Hieroglyphs | 19 Apr 2021 15:39 | 3 |
My solution in Python 3 took 0.062s and 220 KB. Can it be faster? Of course it can! my solution took away just 0.001 sec and 172 kB(in C) Python takes more time than lower level languages and thats why it's not the best idea to use it in a speed based setting |
| hints | Abid29 | 1980. Road to Investor | 19 Apr 2021 15:13 | 1 |
hints Abid29 19 Apr 2021 15:13 just a binary search over overspeeding |
| WA#1 correct answer for sample out test 1 | Bobojon Bobojonov | 1263. Elections | 19 Apr 2021 12:27 | 1 |
object Election1263 extends App { val Array(n, m) = scala.io.StdIn.readLine().split(" ").map(_.toInt) val list = (0 to m - 1).foldLeft(List.empty[Int]){case (acc, _) => scala.io.StdIn.readLine().split("\n").map(_.toInt).toList match { case head :: Nil => acc :+ head case _ => acc } } val electionList = list.groupBy(identity).foldLeft(List.empty[Int]) {(s, e) => s :+ e._2.size } def getPersent(list: List[Int], list1: List[Double]) : List[Double] = list match { case head :: tail => getPersent(tail, list1 :+ head * 100.0 / m) case head :: Nil => getPersent(Nil, list1 :+ head * 100.0 / m) case _ => list1 } val result = getPersent(electionList, List()) result.foreach(e => println("%.2f".format(e) + "%") ) } |
| WA 1st test. I dont understand why. Help pls) | mrFOXY | 1226. esreveR redrO | 19 Apr 2021 11:06 | 1 |
#include <iostream> #include <vector> #include <cmath> #include <string> #include <stack> using namespace std; string solve(string text) { string ts, cs = "", ans = ""; int i = 0; while (i < text.size()) { while(int(text[i]) >= 65 && int(text[i]) <= 122) { ts = ""; // create temp string ts.push_back(text[i]); // translate char to string cs.insert(0, ts); //reverse string i++; } if (i > 0 && int(text[i-1]) >= 65 && int(text[i-1]) <= 122) { ans += cs; //plus to out ans cypher word cs = ""; // make cypher word "" }
ans+=text[i]; i++; } ans += char(0x20); ans += char(0x0a); return ans; } int main() { string s; while(getline(cin, s)) cout << solve(s); } |
| WA2 | Alibi | 1471. Distance in the Tree | 17 Apr 2021 20:38 | 2 |
WA2 Alibi 23 Feb 2015 20:33 What can it be, please? WA2 |
| TESTS | Solus | 1471. Distance in the Tree | 17 Apr 2021 19:40 | 1 |
TESTS Solus 17 Apr 2021 19:40 5 0 1 1 0 2 1 1 3 1 1 4 1 2 3 2 4 3 ans: 3 2 5 1 0 1 2 0 1 3 1 1 4 1 1 2 2 3 4 3 ans: 3 2 3 2 1 1 0 2 1 3 0 0 0 1 1 1 ans: 0 2 0 5 0 1 1 0 2 2 1 3 3 1 4 1 2 2 3 4 3 6 4 ans: 6 4 8 0 1 1 0 2 1 2 3 1 3 4 1 0 5 1 5 6 1 6 7 1 6 7 7 1 4 4 4 4 3 3 4 7 0 ans: 0 4 0 1 1 3 5 0 1 1 1 2 1 3 0 1 0 4 1 4 0 4 4 0 0 2 2 0 ans: 1 1 2 2 Edited by author 17.04.2021 20:29 Edited by author 17.04.2021 20:50 Edited by author 20.04.2021 00:30 Edited by author 20.04.2021 00:41 Edited by author 20.04.2021 23:06 |
| It's simple | Cat36 | 1003. Parity | 17 Apr 2021 15:55 | 15 |
//main logic #include <stdio.h> #include <map> #include <iostream> using namespace std; map<int, bool> exist; map<int, bool> odd; map<int, int> prev; bool add(int a, int b, bool c){//b>=a; if (!exist[b]){ exist[b] = true; odd[b] = c; prev[b] = a; return true; }; int i = prev[b]; if(i==a) return (odd[b]==c); if(i<a) return add(i,a-1, (c!=odd[b])); return add(a,i-1, (c!=odd[b])); }; Thank you very much, at least I solved it! Nice problem! thank you! i study very from you Thanks! nice idea ;) I've got AC thank you very much!!!) Edited by author 01.11.2011 17:53 100 5 5 6 odd 7 8 odd 1 6 even 1 4 odd 7 8 even why result is 3 and not 4? because 1 1 = 0 but 0 0 not 1 the input format is verrrry misleading, i have lost 2 hours of my live because of it. #include <stdio.h> #include <map> #include <iostream> #include <string> using namespace std; map<int, bool> exist; map<int, bool> odd; map<int, int> previous; bool add(int a, int b, bool c){//b>=a; if (!exist[b]){ exist[b] = true; odd[b] = c; previous[b] = a; return true; }; int i = previous[b]; if(i==a) return (odd[b]==c); if(i<a) return add(i,a-1, (c!=odd[b])); return add(a,i-1, (c!=odd[b])); }; int main(int argc, char * argv[]) { while (1) { exist.clear(); odd.clear(); previous.clear(); int numbers = 0; cin >> numbers; if (numbers==-1) break; int questions = 0; cin >> questions; bool flag = false; for (int i = 0; i<questions; i++) { int a = 0; cin >> a; int b = 0; cin >> b; string tmp; cin >> tmp; bool parity = false; if (tmp=="even") { parity = true; } if ((add(a,b,parity)==false)&&(flag==false)) { cout << i; flag=true; } } if (flag==false) { cout << questions; } } return 0; } What wrong? I got wa at 1 test. Then run it in the debug mode and you'll figure it out. change bool parity = false; if (tmp=="even") { parity = true; } to bool parity = true; if (tmp=="even") { parity = false; } and then break after flag=true; Edited by author 21.03.2012 22:25 Edited by author 21.03.2012 22:25{ 100 5 5 6 odd 7 8 odd 1 6 even 1 4 odd 7 8 even why result is 3 and not 4? } I think the answer is 4, because [1,4] is odd and [5,6] is odd and [1,4],[5,6] are continuous then the answer isn't 3, but it is 4. Edited by author 02.05.2012 15:37 Edited by author 02.05.2012 15:40 Edited by author 02.05.2012 15:40 Good programing skills!! Thanks~ :0 this approach is out of my mind, great work!! |
| looks ok but wrong answer,why? | meherin | 2012. About Grisha N. | 16 Apr 2021 17:55 | 2 |
#include<stdio.h> int main() {int f,left,time; scanf("%d",&f); left=12-f; time=left*45; if(time<=240){ printf("Yes");} else{printf("No"):} return 0;} else{printf("No"):} ; not : xd |
| If You have WA 13 | 107th | 1570. Eating High | 16 Apr 2021 13:44 | 3 |
look at overflow!!! in test 13 there are meny than 32 different dishes!!! my bug was: int h = j; ... d[i] |= (1 << h); change it to __int64 h = __int64(j); ... d[i] |= (__int64(1) << h); Edited by author 26.08.2008 17:18 Limit for dishes is 100. Why __int64 (64 bit) should be better than int (32 bit)? In both cases you need an array, don't you? |
| why wa on test 13/?? | leehark | 1570. Eating High | 15 Apr 2021 15:33 | 3 |
CAN SOME ONE GIVE ME SOME TEST? MY GMAIL: LIHE21327@GMAIL.COM First, DP needs to be 2D. Values array can be 1D, but backtracking info should be 2D. At least I couldn't make it 1D. And even after making parental state indication 2D I still had bugs in that back-traversal :) about wa 13 i am pretty sure its a problem with backtracking. |
| hints | Abid29 | 1965. Pear Trees | 13 Apr 2021 18:18 | 2 |
hints Abid29 13 Apr 2021 18:16 its a greedy+dp according to me you should analyze the four scenario like 1. two increasing sequence :
take two array . two array initially have only one value zero. then iterate over 2nd to nth element. if element > 1st and 2nd arrays last element then, 1st sequence last element > 2nd arrays last element then: (add element to the 1st array) otherwise (add element to the 1st array) otherwise add it to the array whose last element < element
(this is optimal ). 2. two decreasing sequence: approach greedily like 1st one 3. one increasing and one decreasing(1st element included in the increasing array):(try yourself) 4. one increasing and one decreasing(1st element included in the decreasing array):(try yourself) for 3rd and 4th criteria , think greedily also. my solution is 0.14sec if you are better plz email me s-2017915104@isrt.du.ac.bd |
| WA2 Hint | Sukarna Paul | 1131. Copying | 13 Apr 2021 17:51 | 1 |
The program is already installed in one computer. Now, we need to install it in (N-1) computers. |