| Show all threads Hide all threads Show all messages Hide all messages |
| c++ Accepted Simple Solution | Trest | 2100. Wedding Dinner | 1 Aug 2021 22:35 | 1 |
#include <iostream> #include <string> int main() { int n, gCount = 2; std::cin >> n; std::string guest; while (n--) { std::cin >> guest; gCount++; if (guest.find("+one", 0) != std::string::npos) gCount++; } if (gCount == 13) gCount++; std::cout << gCount * 100 << std::endl;
return 0; } |
| C++ Accepted 0.001 | Trest | 1197. Lonesome Knight | 1 Aug 2021 22:13 | 1 |
#include <iostream> #include <vector> #include <iterator> int main() { int N; std::cin >> N; char v; int h, c = 0; std::vector<int> result; while (N--) { std::cin >> v >> h; v = v - 'a' + 1; if (h > 1 && v > 2) c += 1; if (h > 1 && v < 7) c += 1; if (h > 2 && v > 1) c += 1; if (h > 2 && v < 8) c += 1; if (h < 8 && v > 2) c += 1; if (h < 8 && v < 7) c += 1; if (h < 7 && v > 1) c += 1; if (h < 7 && v < 8) c += 1; result.push_back(c); c = 0; } std::copy(result.begin(), result.end(), std::ostream_iterator<int>(std::cout, "\n")); return 0; } |
| O(n) solution | qualdum | 1126. Magnetic Storms | 28 Jul 2021 23:07 | 1 |
I get AC with using algorithm with O(n) complexity - just use sliding window Edited by author 28.07.2021 23:07 |
| how to solve | mastercopycode | 1707. Hypnotoad's Secret | 28 Jul 2021 21:42 | 1 |
help me sol this problem my email : npsdn1906@gmail.com |
| Small Hints | irinaguseva | 1777. Anindilyakwa | 25 Jul 2021 21:52 | 1 |
1) Try writing an algorithm for finding the minimum difference in a list first (list.sort() method may come in handy) 2) Think of how the usage of sets and lists may assist you in determining whether we have doublets in your list 3) Use counters for finding the number of iterations in your cycle Enjoy :) Edited by author 25.07.2021 21:52 Edited by author 25.07.2021 21:52 |
| why difficulty is 96? | qualdum | 1644. A Whole Lot of Walnuts | 25 Jul 2021 17:22 | 1 |
I think it's easy problem and must be rated 30 |
| hint for wa24 | qualdum | 1612. Tram Forum | 25 Jul 2021 06:50 | 1 |
check your last string after FOR. I missed this but now Accepted. |
| PBDS_TREE SOLUTION | khdz | 1090. In the Army Now | 25 Jul 2021 00:44 | 1 |
You can use pbds_tree to solve this problem. PBDS Tree function named "order_by_key" will solve the problem like: find number of elements, which lower than x |
| WA12 | Rodion | 1263. Elections | 24 Jul 2021 22:30 | 1 |
WA12 Rodion 24 Jul 2021 22:30 |
| WA on test #12 can someone help me ? | stilkobg | 1263. Elections | 24 Jul 2021 22:27 | 6 |
#include<iostream> #include<iomanip> #include<math.h> using namespace std; double a[10001]; int main() { int l=0,i,n,k; double x,m; cin>>n>>m; for(i=0;i<m;i++) { cin>>k; a[k]++; } for(i=1;i<=n;i++) { x=a[i]/m; x*=100; if(ceil(x)==floor(x))cout<<x<<".00%"<<endl; else cout<<setprecision(4)<<x<<'%'<<endl; } return 0; } Edited by author 09.04.2008 22:50 I have this Problem too. plz help, my program is been written in JAVA. Edited by author 13.10.2011 16:36 So, I have this problem too. What is the rigth solution? --- I found the answer, use Console.WriteLine("{0:f2}%", t); Edited by author 25.10.2012 19:37 Edited by author 25.10.2012 19:37 Try these inputs: 2 11 1 2 2 2 2 2 2 2 2 2 2 I change this >> first multiply 100 and then divide m . and it works. |
| Test for WA#17 | Zhabka | 1964. Chinese Dialects | 23 Jul 2021 13:56 | 1 |
|
| If you have WA #3 | eusebiuu | 1008. Image Encoding | 20 Jul 2021 15:23 | 1 |
Check if the order RTLB is respected and pay attention to the fact that the matrix in the problem is inversed in comparison to the one that you build i.e. the bottom is curr_row - 1 and top is curr_row + 1. |
| wa 3 | Simen | 2142. Magic | 20 Jul 2021 13:56 | 3 |
wa 3 Simen 30 Nov 2019 23:25 whats problem on test 3?? что за проблема на 3 тесте?? Yep Why my code get WA3? #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <cstring> #include <set> #include <map> #include <cmath> #include <algorithm> using namespace std; #define ll long long const ll nmax = 100005; const ll inf = 1234567890123; ll A, B, C; ll X, Y, Z; int main() { cin>>A>>B>>C; cin>>X>>Y>>Z;
if(Z > C) cout<<"There are no miracles in life"; else { ll ess = (ll)0; if(X > A) ess += X - A; if(Y > B) ess += Y - B; if(C - Z >= ess) cout<<"It is a kind of magic"; else cout<<"There are no miracles in life"; }
return 0; } or more simple #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <cstring> #include <set> #include <map> #include <cmath> #include <algorithm> using namespace std; #define ll long long const ll nmax = 100005; const ll inf = 1234567890123; ll A, B, C; ll X, Y, Z; int main() { cin>>A>>B>>C; cin>>X>>Y>>Z;
if(X > A) C -= (X - A); if(Y > B) C -= (Y - B); if(Z <= C) cout<<"It is a kind of magic"; else cout<<"There are no miracles in life";
return 0; } |
| If you got WA on test 3 | Lcyanstars | 1570. Eating High | 20 Jul 2021 11:04 | 1 |
Notice that "Filling value” is THREE decimal places. |
| MLE on Test case 2? | springWaltz | 1096. Get the Right Route Plate! | 18 Jul 2021 22:37 | 1 |
Why always getting mle on #2 |
| WA #7 | Vizir1989 | 1413. Mars Jumper | 18 Jul 2021 21:36 | 2 |
WA #7 Vizir1989 20 Apr 2012 13:15 Hi. Can you give some samples to help fixing WA on test #7? Try using constant with higher precision. Edit: I know that author may not need this hint anymore, but I replied in case anyone was in the same trouble. Edited by author 18.07.2021 21:38 Edited by author 18.07.2021 21:38 |
| WA #3 | raulm | 1303. Minimal Coverage | 18 Jul 2021 20:59 | 4 |
WA #3 raulm 31 Aug 2011 00:26 What can you tell me about this test? I'm having WA all the time Same question. I tried all tests of this problem's forum and still got WA3. Edited by author 25.02.2013 21:48 just try 5 -5 0 0 1 1 2 2 3 4 5 3 4 10 49000 0 0 |
| Please help me, what is wrong? | ARE | 1001. Reverse Root | 18 Jul 2021 19:02 | 2 |
a = list(map(int,input().split())) n = len(a) for i in range(n-1,-1,-1): print("%.4f" % pow(a[i],1/2)) pow(a,b) in Python means the power of integer a and integer b (a^b) use a**b in Python instead. |
| huh, cpu is Broadwell, not sandy/ivy | Anatoliy V Tomilov | | 18 Jul 2021 16:04 | 2 |
#include <iostream> #include <vector> #include <cassert> #define cpuid(func,eax,ebx,ecx,edx)\ __asm__ __volatile__ ("cpuid":\ "=a" (eax),"=b" (ebx),"=c" (ecx),"=d" (edx):\ "a" (func)); int main() { { int a,b,c,d; cpuid(1,a,b,c,d); int extended_model = (a & 0xF0000) >> 12; assert(extended_model == 4 << 4); int family = (a & 0x0F00)>>8; assert(family == 6); int model = (a & 0xF0)>>4; assert(model == 15); int stepping = a & 0xF; assert(stepping == 1); if (__builtin_cpu_is("broadwell")) { std::vector<char>((1ULL << 20)); } } int a, b; std::cin >> a >> b; std::cout << a + b << std::endl; } You're right. The CPU on the judging machine is Intel Xeon E5-2680 v4 (Broadwell). We updated the site news. Thanks for catching this. |
| Give me test 17 please | betty73 | 2148. Insane Shot | 18 Jul 2021 09:36 | 1 |
|