| Show all threads Hide all threads Show all messages Hide all messages |
| its working in codeblocks so whats wrong?? | afia | 1068. Sum | 1 Feb 2024 21:33 | 1 |
#include<stdio.h> int main() { int i,n,sum; scanf("%d",&n); if(n>0) { for (i=1;i<=n;i++) { sum=sum+i; } printf("%d",sum); } if(n<0) { for (i=n;i<=1;i++) { sum=sum+i;} printf("%d",sum);} else if(n==0){ printf("not applicable");} } |
| Test #5 / Тест 5 ошибка - решение | Danil Morozov | 1192. Ball in a Dream | 31 Jan 2024 16:52 | 1 |
If you are getting an error on test 5 then use double instead of float. Если у вас ошибка при 5ом тесте, используйте переменные double вместо float. |
| WA 3 | Raphael Osipov | 1127. Colored Bricks | 31 Jan 2024 14:45 | 1 |
WA 3 Raphael Osipov 31 Jan 2024 14:45 |
| WA 7 | Catalin Cocis | 1232. Asteroid Landing | 27 Jan 2024 15:52 | 2 |
WA 7 Catalin Cocis 23 Apr 2010 23:34 I had WA7 when I computed maximal rotation angle incorrectly. |
| WA2 | Yury_Semenov | 1473. Farm 2 | 25 Jan 2024 12:48 | 1 |
WA2 Yury_Semenov 25 Jan 2024 12:48 |
| What is test#3 | bilibilitdasc | 1655. Somali Pirates | 24 Jan 2024 13:13 | 2 |
I kept getting wrong answer in test#3. What should I do? |
| I think this problem really needs a clearer statement and an explanation of the sample | 337446ZX | 1267. Yekaterinburg Subway | 24 Jan 2024 09:01 | 3 |
I will post one if I solve it. There are n subway stations on a subway line, numbered from 1 to n. The distance between the ith station and the i+1th station is s_i, which means the train need s_i minutes to drive from the ith station to the i+1th. There are trains driving from 1 to n and trains driving from station n to station 1. The trains driving from station 1 to station n departs every d minutes at station 1 and the first one of that departs at d1 minutes. Similarly, The trains driving from station n to station 1 departs every d minutes too at station n and the first one of that departs at dn minutes. However, in this problem the trains are considered not to stay at any station, just drive past A vistor is going to visit every station. He starts from station t. To visit a station, he has to take a train and get off at that station. It takes him 1 minutes to visit a staion, so that he cannot take the train he get off just now. The station t is considered visited. After all visits he need to return to station t. You are going to make a plan for him so that the time cost is minimized. The time cost is calculated as (the time he has visited all stations and gets off a train to station t - the time he departs--getting on a train at station t (can be any train)). Output such time in minutes. Input n s_1 s_2 ... s_(n-1) t d d1 dn Edited by author 24.01.2024 09:02 Explanation of the sample: One possible solution. Take the train to n at 5 and get of to station 3 at 12. Then take the train to 1 at 13 and get of to station 1 at 25. Then take the train to n at 28 and get of to station 2 at 33. It costs 33-5=28 Edited by author 24.01.2024 09:05 |
| WA4 | andreyDagger`~ | 2173. Meta-statement 3 | 24 Jan 2024 08:03 | 2 |
WA4 andreyDagger`~ 28 Jul 2023 21:08 Pay attention to: "wants to see the name of their company in the exactly s_i DIFFERENT problem statements" |
| WA25 | Mortus | 1286. Starship Travel | 15 Jan 2024 14:03 | 1 |
WA25 Mortus 15 Jan 2024 14:03 |
| WA10 | andreyDagger`~ | 2079. Memory leaks | 15 Jan 2024 00:50 | 1 |
WA10 andreyDagger`~ 15 Jan 2024 00:50 |
| WA7 | Mortus | 1608. Lucky Tickets 2008 | 12 Jan 2024 00:41 | 1 |
WA7 Mortus 12 Jan 2024 00:41 |
| What wrong? (с++) | Plotnik | 1001. Reverse Root | 11 Jan 2024 19:59 | 1 |
#include <iostream> #include <algorithm> #include <iomanip> #include <string> #include <vector> #include <cmath> using namespace std; int main() { double element, a; vector<double> numbers; while (cin >> element) { numbers.push_back(element); } reverse(numbers.begin(), numbers.end()); for (size_t i = 0; i != numbers.size(); i++) { a = sqrt(numbers[i]); cout << setprecision(4) << a << "\n"; } return 0; } Edited by author 11.01.2024 20:23 |
| Graph | zhnzhang61 | 1225. Flags | 11 Jan 2024 07:56 | 1 |
Graph zhnzhang61 11 Jan 2024 07:56 n = 1 2 3 4 5 R RW RWR RWRW RWRWR W WR WRW WRWR WRWRW RBW RBWR RBWRW WBR WBRW WBRWR RWBR RWBRW WRBW WRBWR RWRBW WRWBR RBWBR WBRBW Each column can be derived from: 1. the column on its left + R or W and 2. the column on its left's left + BR or BW |
| WA13 | Milica | 1513. Lemon Tale | 10 Jan 2024 16:06 | 3 |
WA13 Milica 22 Dec 2023 16:39 Can someone tell me what is 13.test case? Also, is the only way to solve this problem using long arithmetic? I got time exceeded error. Can somebody tell what is test case? Or tell me how can I optimize my code? I even found to solutions using dp. void lemontale(int n,int k,vector<vector<BigInt>> &mem){ BigInt big_n = BigInt(n); BigInt big_k = BigInt(k); BigInt dva_big = BigInt(2ull); if (mem[n-1][k] == BigInt()){ if (n<0) return ; else if (k==0 && n==1){ mem[n-1][k] = BigInt(1);
} else if (k==0){ lemontale(n-1,k_start,mem); mem[n-1][k] = mem[n-2][k_start];
} else if (n<=k){ BigInt rez = dva_big^big_n;
mem[n-1][k] = rez; } else{
lemontale(n-1,k_start,mem); lemontale(n-1,k-1,mem); mem[n-1][k] = mem[n-2][k-1]+mem[n-2][k_start]; } }
} void lemontale2(int n,int k,BigInt* mem){ BigInt dva_big = BigInt(2ull);
if (mem[n-1]==BigInt()){ if (n<=k) mem[n-1] = dva_big^BigInt(n); else for(int i=0;i<=k;i++){ if (n-i-1 != 0){ lemontale2(n-i-1,k,mem); mem[n-1]+=mem[n-i-2]; } else{ mem[n-1]+=1; } } }
} Edited by author 10.01.2024 16:08 Edited by author 10.01.2024 16:09 Edited by author 10.01.2024 16:09 Edited by author 10.01.2024 16:09 |
| Hint | So Sui Ming | 1302. Delta-wave | 10 Jan 2024 13:55 | 1 |
Hint So Sui Ming 10 Jan 2024 13:55 Find coordinates (x,y,z) of corresponding values and find the manhattan distance between them. Do all in zero-based instead of one-based indices / numbers. e.g. input: 6, 12 (1-bases) => 5, 11 (0-based) value of 5 => (x,y,z) of (2,0,1) value of 11 => (x,y,z) of (3,1,2) manhattan dist = abs(2-3) + abs(0-1) + abs(1-2) = 3 more: input: 398 9999 (1-bases) => 397, 9998 (0-based) (19, 18, 1) (99, 98, 0) ans = 161 c++ fragment: (v = 0-based value) int u = int(ceil(sqrt(v+1))); int x = u-1; int y = -1; if (v == (x+1)*(x+1)-1) y = x; ... else |
| Hint | So Sui Ming | 1346. Intervals of Monotonicity | 10 Jan 2024 11:37 | 1 |
Hint So Sui Ming 10 Jan 2024 11:37 Get rid of consecutive duplicates which are nasty and note that the intervals do not share common point. dp is not needed. |
| this test helps with WA6 | So Sui Ming | 1377. Lara Croft | 10 Jan 2024 09:50 | 1 |
|
| WA 5 | Akashi | 1327. Fuses | 9 Jan 2024 18:04 | 2 |
WA 5 Akashi 13 Sep 2022 21:57 a = int(input()) b = int(input()) if a %2==1 and b%2==1: print(int((b-a)/2+1)) else: print((b-a)//2) Why WA?? What if a = 2 and b = 3? The answer will be 1 but your code will give 0. Now fix it. |
| wa2 c++ sort with comparator | majorro | 1100. Final Standings | 9 Jan 2024 14:58 | 2 |
Why does bool comp(pair<int,int>& a, pair<int,int>& b) { return a.second > b.second; } not AC with common sort? You are not following the bubble sort ordering :) |
| Suggestion: this problem should be removed from the problem set due to its extremely poor statements. | So Sui Ming | 1194. Handshakes | 9 Jan 2024 10:22 | 1 |
|