| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| I don't understand the question. Help !! | Rithik Linkon Penaru | 1083. Факториалы!!! | 12 май 2025 10:33 | 2 |
Can Anyone be kind enough to explain this ques to me? I'll be grateful to you.. You need to calculate factorial form n upto k or n mod k depending on divisibility, by following this pattern (n-0*k)*(n-1*k)*.....*k or n mod k. |
| For those dude who thinks sieve is only option | Shomik Shahriar | 1086. Криптография | 11 май 2025 11:57 | 1 |
DO your own solve then check this do not cheat yourself #include<bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define FastAF ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); template <typename T> // cin >> vector<T> istream &operator>>(istream &istream, vector<T> &v){for (auto &it : v) cin >> it;return istream;} template <typename T> // cout << vector<T> ostream &operator<<(ostream &ostream, const vector<T> &c){for (auto &it : c) cout << it << " ";return ostream;} const int mx=2e5; int ar[mx]; void d(){ ar[0]=2; int k=1; for(int i=3;i<mx;i++){ bool f=true; for(int j=2;j*j<=i;j++){ if(i%j==0){ f=false; break; } } if(f){ ar[k++]=i; } } } int main(){ FastAF d(); int n; cin>>n; while(n--){ int a;cin>>a; cout<<ar[--a]<<endl; } return 0; } Algo: sqrt with precomputation Edited by author 11.05.2025 11:58 Edited by author 11.05.2025 12:02 |
| WA 55 | anotherworld | 2184. Любимое число Флинта | 9 май 2025 02:32 | 1 |
WA 55 anotherworld 9 май 2025 02:32 |
| nice test | 👑TIMOFEY👑`~ | 1762. Поиски тайника | 3 май 2025 17:37 | 1 |
|
| ests | andreyDagger`~ | 1464. Освещение | 1 май 2025 03:48 | 1 |
ests andreyDagger`~ 1 май 2025 03:48 0 0 16 1 1 2 1 2 0 3 0 3 1 2 2 3 2 4 1 4 3 0 3 0 4 1 4 1 5 -1 5 -1 -1 1 -1 12.00000000000000000000 0 0 5 -1 -1 1 0 0 -1 2 -2 2 4 5.50000000000000000000 0 0 17 -1 -1 5 -1 1 0 1 1 2 2 2 1 3 1 3 3 4 4 4 3 5 3 5 5 0 5 0 6 6 6 6 7 -1 7 24.00000000000000000000 0 0 4 0 -1 1 0 0 1 -1 0 2.00000000000000000000 0 0 4 -1 2 -1 -1 1 0 3 -1 3.6666666666 0 0 3 -1 -1 1 -1 0 1 2.00000000000000000000 0 0 11 0 -1 3 0 2 2 1 1 2 3 0 4 0 3 -1 5 -2 3 0 2 -1 0 10.50000000000000000000 |
| hint please | sailingoat | 2041. Наноматрёшки | 29 апр 2025 21:03 | 1 |
I would appreciate hints(or solution) a lot! Please e-mail me at addflash@dmc.chat |
| Question about sample | ConnorChang | 1143. Electric Path | 28 апр 2025 05:03 | 1 |
Why is the sample 50.211, shouldn't the sample be 50.198 because the path (45, 0) -> (50, 1) -> (5, 1) -> (0, 0) is length 50.198? |
| I am curious | andreyDagger`~ | 2053. Биология | 25 апр 2025 01:41 | 1 |
Is there some constructive approach? I solved it with some tricky bruteforce with optimizations |
| wa 6 | 👑TIMOFEY👑`~ | 2174. Дуализм чисел | 24 апр 2025 18:22 | 1 |
wa 6 👑TIMOFEY👑`~ 24 апр 2025 18:22 |
| hint | LeTim | 1465. Игра в пешки | 24 апр 2025 15:07 | 1 |
hint LeTim 24 апр 2025 15:07 find out how to solve the problem for n <= 68. for bigger n just do n = (n - 35) % 34 + 35 and solve the problem for this n. |
| bad constraints | LeTim | 2047. Математика | 23 апр 2025 15:41 | 1 |
i think the memory limit should be higher |
| Язык отправки | DrugovaAleksandraVasilievna | 1275. Knights of the Round Table | 21 апр 2025 22:34 | 1 |
Отсутствует язык отправки C# |
| easy bfs | 👑TIMOFEY👑`~ | 1774. Парикмахер армии магов | 19 апр 2025 17:54 | 2 |
this is a very cool task, it requires a little out-of-the-box thinking, I really liked it |
| WA 12 test | Alikhan Zimanov | 1966. Велодорожки | 19 апр 2025 17:19 | 2 |
Input: 4 2 1 1 5 3 7 -1 4 7 1 2 3 4 Correct output: NO One of the reasons of "WA" might be that your solution incorrectly determines whether two segments intersect or not. Edited by author 11.04.2020 15:09 |
| If you wa on test 19 | vectorlmn | 1739. Фарюки | 17 апр 2025 17:15 | 1 |
Maybe you output multiple answers. Reason: after output a correct answer,the program should be exit,but you may not do that. (I'm sorry for my bad English) |
| some tests | LeTim | 1519. Формула 1 | 17 апр 2025 15:07 | 1 |
Input 2 2 .. .. Output 1 Input 12 12 ************ ************ ************ ******..**** ******..**** ************ ************ ************ ************ ************ ************ ************ Output 1 Input 2 4 .... **** Output 0 Input 4 2 .* .* .* .* Output 0 Input 2 5 ..*.. ..*.. Output 0 Input 5 2 .. .. ** .. .. Output 0 Input 12 12 ............ ............ ............ ............ ............ ............ ............ ............ ............ ............ ............ ...........* Output 0 Input 6 6 ...... ...... ..**.. ..**.. ...... ...... Output 14 Input 6 6 ...... ...... ...... ...... ...... ...... Output 1072 Input 12 12 ............ ............ ............ ............ ............ ............ ............ ............ ............ ............ ............ ............ Output 1076226888605605706 |
| Here are some tests. | vectorlmn | 1895. Бифштексы на борту | 15 апр 2025 20:32 | 1 |
input: 10 3 10 2 4 8 9 9 10 11 18 22 29 output: 8 0 1 0 3 0 3 1 8 1 8 3 9 8 9 9 17 17 21 21 28 input: 10 3 50 70 113 132 135 135 136 140 140 140 144 194 231 242 275 287 337 359 362 381 391 418 432 436 478 530 541 551 553 560 560 567 575 594 631 634 646 649 676 702 728 738 771 824 858 889 907 922 933 976 987 output: 75 60 69 103 112 125 131 125 131 125 134 130 134 130 139 130 139 131 139 134 143 184 193 221 230 232 241 265 274 277 286 327 336 352 358 352 358 371 380 381 390 408 417 426 431 426 431 468 477 520 529 531 540 543 550 543 552 550 552 550 552 565 566 565 566 584 593 624 630 624 630 639 645 639 645 666 675 692 701 718 727 728 737 761 770 814 823 848 857 879 888 897 906 912 921 923 932 966 975 977 986 |
| Handling Input | HappyPerson | 1644. Куча орехов | 12 апр 2025 12:28 | 3 |
Is there a way to just get the first character of the type of experiment? (Like, if it is "hungry" just receive the "h" and ignore the rest) Why can't you use string and only judge the string[0]? Input Values is not in a range [3, 9] |
| Test data | Tolstobrov Anatoliy[Ivanovo SPU] | 1739. Фарюки | 12 апр 2025 09:46 | 3 |
Test data Tolstobrov Anatoliy[Ivanovo SPU] 10 окт 2016 19:09 Some data which will help understand problem and test it! Test: 2 40 223 Answer: 3 aromatize 1 dearomatize 1 take 2 1 2 Test: 3 50 55 158 Answer: 3 aromatize 2 dearomatize 1 take 3 1 2 3 Test: 4 100 512 128 146 Answer: 3 aromatize 1 dearomatize 2 take 4 1 2 3 4 Test: 2 100 135 Answer: IMPOSSIBLE Test: 2 400 31 Answer: IMPOSSIBLE Test: 2 100 171 Answer: IMOSSIBLE Thank you very much! I got AC from first submit after my code finally work on all your test cases. |
| hint | coder | 1819. Профессиональный подход | 7 апр 2025 23:34 | 7 |
hint coder 19 июл 2012 14:57 3-edge connected components of graph. A Simple 3-Edge Connected Component Algorithm by Yung H. Tsin. But I self do not found this article :) I have a stupid idea to solve this problem: first ,dfs a tree, then for each node compute the hash_value of edge set which cover this node.. for each query a,b if for every node on the path of (a,b) the set of edge cover by this node is not equal to any node outside the path of (a,b) and times of edge segments covered the path >=2 then result is Yes,otherwise it is no.. I'll try to use president tree to implement this idea... hope there is nothing wrong.. Edited by author 05.12.2016 14:35 Edited by author 05.12.2016 14:35 WA on test # 18,any one help?? AC 0.421s O(n*log(n)^2) its log(n)^2 because I use heavy_light decomposion+segment_tree ccz181078 has give a random solution to the sub problem of this problem:: give a tree with n node,n<=50000 for every edege there is a color 1<=c<=50000, give q<=50000 queries ,for each query give two node a,b judge for every color on path a-->b this color appear only on the path a--->b ,not outside path a--->b. sol :for every edge gives a random 32 bit number, so that for every col xor of edge with this color is zero.. for each query just judge if xor of random number on this path is zero. if it is ,answer is Yes, otherwise it is No You're wrong. The answer may be "Yes" but nodes not in one 3-edge connected component Sorry, I'm stupid, it works |