Общий форум| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | | solution keeps getting marked as incorrect... | noob dev | 1933. Пушки к бою! | 31 дек 2014 10:51 | 1 | My solution for "guns for battle" keeps getting marked as wrong and I don't know why. Any ideas? import java.util.*; import java.io.*; public class Gunner{ public static void main(String[] args) throws Exception{ StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); PrintWriter out = new PrintWriter(System.out); in.nextToken(); int n = (int)in.nval; int x = (2 * n) + 1;
int r = 1, c=1; while( r <= x) { while(c <= x){ if(r == c) out.print(0+" "); else out.print((r-1) + (c-1))+" "); out.flush(); ++c; } out.println(); out.flush(); c = 1; ++r; } } } | | Reverse Root 1001 Runtime error C# | Blaine | 1001. Обратный корень | 31 дек 2014 08:08 | 1 | I cant figure out how the code receives the input data, if anyone could shed some light on how to fix my code that would be very much appreciated. using System; using System.Collections.Generic; class Program { static void Main() { var rootList = new List<string>();
string aLine = Console.In.ReadToEnd();
string[] separators = {" "};
var arguments = aLine.Split(separators , StringSplitOptions.RemoveEmptyEntries); foreach (var arg in arguments) {
rootList.Add(Math.Sqrt(long.Parse(arg)).ToString("#.####"));
} rootList.Reverse();
foreach(string root in rootList) { Console.WriteLine(root);
}
} } | | Can somebody give me some test data,plz?(-) | Ural_Happy New Year! | 1015. Найдите различия! | 30 дек 2014 16:43 | 9 | when you output your data, this one is collect: 3 1 2 3 4 6 5 but this is not collect: 3 1 2 3 4 6 5 mind the last space in the last of every line. > when you output your data, > this one is collect: > 3 > 1 2 3 > 4 6 > 5 > but this is not collect: > 3 > 1 2 3 > 4 6 > 5 > > mind the last space in the last of every line. No, it's not true! I've simply written to output 3 1_2_3_ 4_5_ 6_ Where sing "_" means space " ". This is not important during writing output. Hello, here is my test data, generated randomly: <input> 1000 2 5 4 6 1 3 2 3 6 5 1 4 4 3 2 6 1 5 2 5 4 6 3 1 6 5 2 3 4 1 4 1 3 2 6 5 5 1 6 4 3 2 3 2 4 6 5 1 6 5 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5 2 4 1 6 3 4 3 5 6 1 2 3 6 5 2 1 4 4 6 2 3 1 5 4 2 5 3 1 6 5 6 1 2 3 4 2 4 5 3 6 1 5 6 1 2 3 4 2 5 1 3 4 6 5 6 2 3 4 1 5 3 2 1 6 4 2 3 6 4 1 5 6 2 1 3 5 4 6 2 3 1 5 4 2 6 1 5 3 4 3 2 5 1 4 6 1 3 6 4 2 5 4 1 2 5 3 6 1 6 3 4 2 5 5 4 3 6 1 2 4 2 5 1 3 6 1 3 4 6 2 5 1 4 2 5 6 3 2 4 6 5 1 3 1 2 3 6 4 5 1 5 3 4 2 6 1 2 5 4 3 6 5 4 6 2 1 3 2 6 5 4 1 3 5 3 6 2 4 1 5 6 1 4 3 2 1 6 3 2 4 5 5 4 6 3 2 1 5 6 2 4 1 3 2 6 5 4 1 3 5 6 1 4 3 2 5 3 4 2 1 6 4 2 5 1 3 6 3 6 1 5 4 2 4 1 6 5 3 2 5 1 3 4 6 2 4 6 5 3 2 1 3 5 1 2 6 4 2 3 6 1 4 5 5 1 6 3 4 2 2 3 6 4 5 1 3 1 5 6 4 2 6 1 5 2 3 4 5 6 4 2 1 3 2 6 4 5 3 1 1 2 6 4 3 5 5 1 4 6 2 3 5 4 6 1 2 3 </input> and the correct (Accepted) answer: <output> 30 1 34 36 54 114 130 170 216 310 315 326 331 401 421 437 448 470 478 602 654 689 708 737 762 764 776 777 789 825 841 856 872 916 946 956 986 2 55 123 145 147 177 300 302 349 353 357 359 391 432 450 489 542 562 609 655 668 675 769 774 804 835 862 925 943 966 3 31 61 99 106 138 192 297 301 312 325 332 344 348 386 397 403 490 517 586 703 738 754 780 786 790 811 820 821 847 850 857 884 906 908 923 929 981 4 10 43 62 63 70 113 140 181 236 268 270 306 345 368 422 436 454 472 536 539 563 589 608 631 678 688 704 743 748 802 940 947 5 9 17 30 88 94 125 155 178 263 267 280 293 381 399 426 509 518 558 593 603 635 637 641 650 697 710 718 730 758 828 839 849 854 873 888 926 954 978 983 6 92 122 131 144 172 213 299 323 334 343 392 626 656 772 773 816 870 922 987 7 39 51 82 115 117 161 183 218 222 223 227 237 248 283 311 321 356 410 415 429 452 458 483 521 551 554 621 651 662 680 719 740 801 813 843 851 866 868 883 887 889 901 921 942 8 12 53 134 135 163 194 207 246 253 317 378 383 529 597 605 607 619 639 712 742 755 761 779 824 848 874 959 963 975 11 38 93 107 119 137 159 220 260 407 442 462 467 502 505 540 627 636 707 739 745 750 753 766 795 817 836 965 996 13 48 83 112 132 148 156 167 200 219 224 243 250 254 273 294 322 340 361 366 412 465 519 525 565 581 596 600 644 645 663 674 683 726 759 788 864 899 964 967 1000 14 25 87 104 160 164 171 197 241 379 382 388 390 402 460 474 476 514 516 528 538 550 564 685 751 798 805 814 831 842 880 882 903 905 973 991 15 24 45 74 109 120 136 189 195 196 209 234 259 279 303 319 434 471 479 500 523 534 557 601 625 640 676 701 705 734 746 765 803 826 830 915 938 962 980 994 16 18 72 76 95 150 215 245 249 265 314 320 335 347 395 468 480 485 493 577 585 588 599 614 647 664 677 681 691 692 714 721 729 823 890 904 945 951 974 977 19 52 71 89 101 154 240 288 371 372 495 548 567 591 620 633 670 717 724 744 747 757 808 818 829 845 869 914 927 939 993 20 44 69 73 103 174 210 278 285 307 354 373 384 389 413 425 451 453 456 482 501 530 547 560 576 580 606 622 646 657 679 682 700 770 840 853 855 900 933 21 57 80 251 261 272 287 339 396 445 473 477 507 522 553 623 709 736 837 891 894 920 998 22 64 65 121 180 186 190 198 199 225 233 239 289 291 309 374 420 492 532 595 643 648 669 694 733 749 800 819 949 976 982 23 35 49 59 66 68 79 203 211 221 262 292 393 406 409 419 431 488 494 511 555 561 574 629 711 768 793 875 886 992 26 28 84 128 217 226 255 256 282 316 330 333 341 363 424 439 459 520 559 573 615 716 720 725 787 858 897 917 919 972 27 41 75 97 111 124 139 175 264 337 380 385 387 446 487 533 569 610 612 618 693 715 783 833 910 930 941 968 985 990 29 60 91 98 116 168 229 238 271 296 328 342 362 370 398 440 556 611 672 698 727 799 815 876 918 948 989 32 102 133 151 257 284 324 351 355 365 428 457 461 466 503 527 545 568 578 582 587 592 658 735 827 913 924 960 997 33 47 58 105 158 187 235 269 274 275 346 350 360 418 443 464 469 499 613 642 794 885 902 907 936 950 952 988 999 37 50 81 100 110 118 126 127 142 143 157 184 193 212 230 286 295 329 375 394 417 449 513 526 537 546 570 571 590 624 630 659 781 792 807 810 859 867 877 878 881 912 979 40 86 90 146 149 277 281 411 441 444 455 484 496 524 552 566 634 652 760 767 806 809 812 832 838 852 861 871 896 944 961 970 42 176 205 206 242 244 247 266 318 400 408 427 504 543 598 617 653 660 661 713 722 723 784 785 892 893 934 937 46 56 67 108 169 231 276 305 313 338 352 405 414 430 491 506 510 512 535 544 649 665 671 686 695 699 702 741 756 771 775 782 791 895 898 909 932 971 995 77 96 141 153 162 166 173 182 191 201 202 204 214 252 298 358 364 416 423 433 481 579 594 628 632 638 667 687 706 822 879 958 984 78 85 129 179 290 308 327 336 367 369 377 435 447 463 508 531 541 583 584 673 684 731 778 796 834 844 846 860 863 865 928 931 935 953 955 957 969 152 165 185 188 208 228 232 258 304 376 404 438 475 486 497 498 515 549 572 575 604 616 666 690 696 728 732 752 763 797 911 </output> Good luck, Alex PS: !!! please note, that there may be some newlines, mis-inserted by my browser !!! Thanks to this data,I got AC at last. Thank you! Thanks to many tests.I am glad.I was worked solution by you test.I got AC already. tryhard Edited by author 30.12.2014 16:44 | | Statement issue | Alexey Shmelev | 2007. Мутанты против машин | 30 дек 2014 05:25 | 1 | It is not clear from statement whether it is allowed to remove previously inserted modifier from the string using operation 2: "Choose the position in the DNA sequence that contains a *letter*" while in operation 1: "Insert a *gene modifier* into any place of the DNA". AC solution assumes that gene_modifier==letter, so answer for a zz Is "a", not "azz" | | Wrong answer 14 (hint)[condition:wa14 serveral times] | kaa..........ai | 1497. Разрезание квадрата | 29 дек 2014 23:32 | 1 | Try these data: 7 0000000 0000000 0011111 0011111 0011111 0011111 0000111 5 00111 01111 01111 00000 00000 5 11000 10000 10000 10000 11000 5 00011 00001 00001 00011 00111 output: Yes Good luck! | | Hint | pav1uxa | 1110. Степень | 29 дек 2014 23:20 | 1 | Hint pav1uxa 29 дек 2014 23:20 del Edited by author 06.01.2015 21:37 | | [n/m]==[n/(m+1)] | Wang Jia | 1705. Зайцы-бандиты | 29 дек 2014 20:39 | 5 | maybe the problem can be abstracted as the following one: n,m are integers, n given, find the smallest m such that [n/m]==[n/(m+1)] holds, where [] denotes the floor() function. well, anyone has any ideas? Yes, it's redefinition of problem. but how can i find such an m? a binary search does seems not to work... The binary search works. But it isn't a binary search by the answer. ;) I use binary search of answer in range Sqrt(n) and Sqrt(n) + Sqrt(Sqrt(n)) | | Thanks | Alex Danilyuk[UFU Dandelion]`` | 1916. Руины титанов: в ожидании стабильности | 29 дек 2014 17:59 | 1 | Thanks Alex Danilyuk[UFU Dandelion]`` 29 дек 2014 17:59 Great problem! Thanks to the authors! | | Do NOT forget to output the "Passed" - word in the end, for WA#5!!!! | Yerlan | 1269. Антимат | 29 дек 2014 17:14 | 1 | | | HELP!!! WA14 | Alibi | 1644. Куча орехов | 29 дек 2014 15:47 | 1 | | | I don't pass test 6 | gustavo Inzunza | 1123. Зарплата | 29 дек 2014 14:55 | 3 | Meeeeeeeeeee toooooooooo. Try this data: input: 123401 output: 124421 | | Need help with WA #10 | Megakrit | 1106. Две команды | 29 дек 2014 01:45 | 3 | If anybody know test cases which broke the program, please, share them. Thanks in advance. UPD: Below is the algorithm I used to solve this problem, but still got WA#10. Please suggest any test case which can break the algorithm. Let's suppose we have two arrays (Collections) named e.g. Left and Right. These collections are empty. So, we iterate through the numbers from 1 to N. If any of the collections contain the current number we do nothing. Otherwise (this is the first occurrence of this number), we put current number into the Left collection and start iterating through his friends: The logic here is almost the same. We check whether the current friend is present in any of the collections. If he's not, we put the friend into the Right collection. For example, how this algorithm works on the input data from the problem statement: 1. Current number is 1. Left and Right are empty, so we put 1 into the Left collection and (it's obvious) put all his friends into the Right collection. So the state after the first step is: Left = {1}; Right = {2, 3} 2. The next number is 2. It's present in the Right, so we skip it. 3. The next number is 3. It's also present in the Right, so we skip it. 4. Current number is 4. Neither Left nor Right contain this number, so we put it into the Left. So the current state became - Left = {1, 4}; Right = {2, 3}. 4.1. We iterate through the friends list of the 4. There are the only number 3, which is already present in the Right, so we do nothing. 5. The next number is 5. Here we have the same situation as on the previous step, so the current state became: Left = {1, 4, 5}; Right = {2, 3} 6. Current number is 6. It's not present in Left and Right, so we put it into the Left and the current state became - Left = {1, 4, 5, 6}; Right = {2, 3}. Now we iterate through the list of friends of the 6. There is the only friend 7, which is not present in Left and Right, so we put 7 into the Right collection. 7. Current number is 7, which is already present in the Right, so we do nothing. And the result is: Left = {1, 4, 5, 6}; Right = {2, 3, 7} And the program output is: 4 1, 4, 5, 6 I tried lots of combinations, but they all work correctly. Edited by author 12.02.2013 00:00 Please, correct me if I'm wrong. As I understand from the problem statement, the input must have data which can easily be converted to the matrix with values in cells: 1 - friendship, 0 - non-friendship. So, the "default" test case can be represented as such matrix: 0 1 1 0 0 0 0 1 0 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 I tried to form the test input data such as it'll break the algorithm above, but still is there... It seems that it's impossible to set friendship in such a way that 7 will be a friend of any other and they both will be putted into the same collection. Also, as I understand, the number of people doesn't matter in the resulting teams. So the answer for the input: 4 2 3 4 0 1 3 4 0 1 2 4 0 1 2 3 0 can be: 1 1 Check if this case will work: 4 2 0 1 4 0 4 0 2 3 0 | | make note:wa7 | kaa..........ai | 1348. Пусти козла в огород 2 | 28 дек 2014 03:55 | 1 | Try this test(Sorry for my poor English): -2 -1 -4 -3 2 -1 1 correct output data: 3.00 5.32 | | why it wrong at Test11? | 116040179 | 1297. Палиндромы | 27 дек 2014 23:25 | 2 | #include <stdio.h> #include <string.h> #include <string> #include <algorithm> using namespace std; #define maxn 2000010
int wa[maxn],wb[maxn],wv[maxn],wss[maxn]; int rank[maxn],height[maxn]; int sa[maxn],r[maxn]; char str[maxn]; char temp[maxn];
int cmp(int *r,int a,int b,int l) { return r[a]==r[b]&&r[a+l]==r[b+l]; }
void da(int *r,int *sa,int n,int m) { int i,j,p,*x=wa,*y=wb,*t; for(i=0; i<m; i++) wss[i]=0; for(i=0; i<n; i++) wss[x[i]=r[i]]++; for(i=1; i<m; i++) wss[i]+=wss[i-1]; for(i=n-1; i>=0; i--) sa[--wss[x[i]]]=i; for(p=1,j=1; p<n; j*=2,m=p) { for(p=0,i=n-j; i<n; i++) y[p++]=i; for(i=0; i<n; i++) if(sa[i]>=j) y[p++]=sa[i]-j; for(i=0; i<n; i++) wv[i]=x[y[i]]; for(i=0; i<m; i++) wss[i]=0; for(i=0; i<n; i++) wss[wv[i]]++; for(i=1; i<m; i++) wss[i]+=wss[i-1]; for(i=n-1; i>=0; i--) sa[--wss[wv[i]]]=y[i]; for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1; i<n; i++ ) x[sa[i]]=cmp(y,sa[i-1],sa[i],j)?p-1:p++; } }
void calheight(int *r,int *sa,int n) { int i,j,k=0; for(i=1; i<=n; i++) rank[sa[i]]=i; for(i=0; i<n; height[rank[i++]]=k) for(k?k--:0,j=sa[rank[i]-1]; r[i+k]==r[j+k]; k++); }
int main() { while(scanf("%s",str)!=EOF) { int i; int len1=strlen(str); strcpy(temp,str); reverse(temp,temp+len1); //printf("%s\n",temp); memset(sa,0,sizeof(sa)); memset(r,0,sizeof(r)); memset(rank,0,sizeof(rank)); memset(height,0,sizeof(height)); str[len1]='#'; for(i=len1+1;i<1+len1*2;i++) str[i]=temp[i-len1-1]; str[i]='\0'; for(i=0;str[i]!='\0';i++) r[i]=str[i]; da(r,sa,i+1,256); calheight(r,sa,i); int k=0,n=i,max=-1; for(i = 2; i <= n; ++ i) if((sa[i]<len1)^(sa[i-1]<len1)) if(k<height[i]){ k=height[i]; max=i; } else if(k==height[i]){ // printf("i=%d max=%d\n",sa[i],sa[max]); if(sa[max]>sa[i]) max=i; } i=sa[max]; for(;i<sa[max]+k;i++) printf("%c",str[i]); printf("\n"); } return 0; } try this test case: aabcc output should be:aa my program was also getting WA on test case 11,when i corrected the program for this test case,it got accepted.I hope it helps you.Thank you. Edited by author 27.12.2014 23:33 Edited by author 27.12.2014 23:33 Edited by author 27.12.2014 23:36 | | is it posible? | Dato Chkhaidze[TSU] | 1910. Руины титанов: сокрытый вход | 27 дек 2014 12:41 | 5 | This input is invalid according to the problem statement. With input: 1 4 1 4 1 4 The result should be: 9 3 There can be only one answer. The test-case is invalid. | | Problem not completely understood, help please! | Najmaddin Akhundov | 1910. Руины титанов: сокрытый вход | 27 дек 2014 12:38 | 2 | If we have input: 6 7 8 9 1 1 1 What should be output? 24 3 or 24 2 24 2 8 stands at 2nd section. | | WA#20 | Paulinho | 1910. Руины титанов: сокрытый вход | 27 дек 2014 12:33 | 2 | WA#20 Paulinho 30 ноя 2014 23:26 #include <iostream> using namespace std; void main() { int n; int a[998]; cin>>n; int i; int s=0; int smax=0; int imid=0; for(i=0;i<n;i++) { cin>>a[i]; } for(i=0;i<n-2;i++) { s=a[i]+a[i+1]+a[i+2]; if(s>smax) { smax=s; imid=i+2; } } cout<<smax<<" "; cout<<imid; } What did i do wrong ? why have you taken array of size 998? make it 1000. | | WA #7 Please can you give me some TEST! | Tukenov | 1326. Крышки | 26 дек 2014 13:08 | 1 | Edited by author 26.12.2014 13:39 | | Help! Solution | Artem Berezovsky | 1230. Интроспективная программа | 26 дек 2014 10:22 | 2 | Edited by author 20.09.2022 09:22 Edited by author 20.09.2022 09:22 | | WA 8 possibility | Kuros | 1423. Басня о строке | 26 дек 2014 02:35 | 1 | If you get WA 8 you might not be checking correctly for string equality once the hash goes through (false positive). |
|
|