| Show all threads Hide all threads Show all messages Hide all messages |
| TLE #42 | Mirjalol Bahodirov | 1915. Titan Ruins: Reconstruction of Bygones | 18 Mar 2019 22:29 | 3 |
TLE #42 Mirjalol Bahodirov 23 Dec 2015 02:44 Thank you for your advice! I used BufferedInputStream/BufferedOutputStream and that gave me a great boost (from 0.98 to 0.156)! in c++ use ios_base::sync_with_stdio(0); |
| WA TEST #6. | Jumabek Alikhanov | 2020. Traffic Jam in Flower Town | 18 Mar 2019 12:32 | 2 |
Can anyone give me some clue please? Re: WA TEST #6. George_Aloyan[PTS_Obninsk][MIPT_DPQE][MIPT_PSEPMS][IPG] 18 Mar 2019 12:32 Try this test: LFR FLR Ans should be 4, not 5 |
| python ez solution | fatnet | 1585. Penguins | 17 Mar 2019 12:18 | 1 |
n = int(input()) d = {} for i in range(n): s = input() if s not in d: d[s] = 0 d[s] += 1 ans = sorted(d.items(), key=lambda kv: kv[1])[-1][0] print(ans) |
| 1 | Goergiy | 1079. Maximum | 17 Mar 2019 12:09 | 1 |
1 Goergiy 17 Mar 2019 12:09 |
| easy MST | amomorning | 1982. Electrification Plan | 17 Mar 2019 10:42 | 2 |
use prim or kruskal can solve it. |
| WA on 6. Can anyone tell me why? | raphaelrbr | 1671. Anansi's Cobweb | 17 Mar 2019 04:29 | 1 |
#include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second #define mp make_pair #define pii pair<int,int> #define vi vector<int> #define pq priority_queue #define pb push_back #define watch(x) cout << (#x) << " is " << (x) << endl #define ALL(a) (a.begin()),(a.end()) #define FOR(x,to) for(x=0;x<(to);x++) #define FORI(a,b) for(int i = a; i<b; i++) #define fastio ios::sync_with_stdio(0); cin.tie(NULL); const int INF = 0x3f3f3f3f; struct ar{ ll x,y; }; ar v[100100]; int p[100100] = {0}; ll id[100100]; ll sz[100100]; ll num; ll find(ll x){ if(id[x] == x) return x; return id[x] = find(id[x]); } void join(ll x, ll y){ ll p = find(x); ll q = find(y); if(p==q) return; num--; if(sz[p] > sz[q]) { ll t = q; p = q; q = t; } id[p] = q; sz[p] += sz[q]; } int main(){ fastio ll n,m,i,q; cin >> n >> m; num = n; ll arf[100100]; ll ans[100100];
FOR(i,m){ cin >> v[i+1].x >> v[i+1].y; } FOR(i,m+1){ id[i+1] = i+1; sz[i+1] = 1; } cin >> q; FOR(i,q){ ll x; cin >> x; p[x] = 1; arf[q-i] = x; } FOR(i,m+1){ if(i==0) continue; if(!p[i]){ join(v[i].x, v[i].y); } }
ans[q] = num; for(int i = 1; i<=q; i++){ join(v[arf[i]].x, v[arf[i]].y);
ans[q-i] = num;
}
for(int i = 1; i<=q; i++){ cout << ans[i] << " "; }
cout << "\n"; return 0; }
Edited by author 17.03.2019 04:30 |
| что не так с кодом? | Demorald | 1001. Reverse Root | 17 Mar 2019 04:01 | 1 |
#include <iostream>; #include <vector>; #include <string>; #include <sstream>; #include <iomanip> using namespace std; int main() { int temp; vector <double> answers; string s; getline(cin, s); istringstream iss(s); while (iss >> temp) { double a = sqrt(temp); answers.push_back(a); } for (int i = answers.size(); i > 0; i--) { cout << fixed << setprecision(4) << answers[i-1]; cout << endl; }
system("pause"); return 0; } |
| Runtime error Test #6 (ノ-_-)ノ彡┻━┻ | netufantazii | 1123. Salary | 15 Mar 2019 22:09 | 1 |
sorry, I'm just an idiot... Edited by author 27.03.2019 22:39 |
| 3 test!!! | Julia | 2035. Another Dress Rehearsal | 15 Mar 2019 12:34 | 1 |
|
| WA#3 | VladimirZagorodskih | 1020. Rope | 15 Mar 2019 02:18 | 5 |
WA#3 VladimirZagorodskih 28 Feb 2010 10:57 I couldn't understand my mistake! On my tests it works correct. program project1; var n, i : longint; r, res, x, y, x1, y1, x0, y0 : extended; begin {$IFNDEF ONLINE_JUDGE} assign(input, 'input.txt'); assign(output, 'output.txt'); reset(input); rewrite(output); {$ENDIF} readln(n, r); readln(x, y); x0:=x; y0:=y; res:=2*pi*r; for i:=1 to n-1 do begin readln(x1, y1); res:=res+sqrt(sqr(x1-x)+sqr(y1-y)); y:=y1; x:=x1; end; res:=trunc(res*100)/100; write((res+sqrt(sqr(x1-x0)+sqr(y1-y0))):1:2); {$IFNDEF ONLINE_JUDGE} close(input); close(output); {$ENDIF} end. Re: WA#3 Petrova Valentina [USU] 3 Mar 2011 23:46 I've got the same problem=) May be there is a mistake with counting doubles (extended) and printing the answer... I suppose Edited by author 03.03.2011 23:46 Edited by author 03.03.2011 23:47 On the test 3 n=1, so you need to print the perimeter of nail. Good luck Re: WA#3 Mehedi Imam Shafi 26 Sep 2016 10:51 On the test 3 n=1, so you need to print the perimeter of nail. Good luck thanks helped Re: WA#3 Mozammal Hossain 15 Mar 2019 02:18 for n=1,r=1. What will be the answer? is there any effect on axes position? |
| ??? | Search | 1607. Taxi | 12 Mar 2019 23:15 | 13 |
??? Search 2 Mar 2008 01:06 Please help me.I always have WA#4. Give me any tests. THAnk!!!>< Try this: 1) 100 100 150 20 Answer is 150 2) 100 100 50 20 Answer is 100 Now I've WA#14.Please give some new tests.Thank!!! Edited by author 03.03.2008 20:06 denton> Thanks for the first test. It really helped me!!! Re: ??? Plamen_Iliev 5 Apr 2008 19:36 I think the answer is 200!!! wrong Velea Alex 29 Dec 2008 22:57 Posted by denton March 02, 2008 15:11 Try this: 1) 100 100 150 20 Answer is 150 2) 100 100 50 20 Answer is 100 re:::: at test 2 the answer is 50 becouse the taxi driver ofer him 50 and in less then 100 :D Edited by author 29.12.2008 22:58 Edited by author 29.12.2008 22:58 You are wrong, 'cause first turn is Petr and after that the turn of driver, but I think driver wasn't stupid one and he would not offer Petr smoller summ. Re: wrong Bahodir | {TUIT} | 29 Nov 2014 17:24 Accepted Test: 3 3 5 2 5 Edited by author 29.11.2014 20:35 thanks a lot, your tests helped me Hi, I have issue with the case "100 100 50 20"... Because logically the drivers shouldnt ask a price < price offer from Peter.. Re: ??? gunfighter 12 Mar 2019 23:15 thanks for the test, helped to get AC after WA#4 Edited by author 12.03.2019 23:16 Re: ??? Bahodir | {TUIT} | 29 Nov 2014 17:07 Inpt : 1 2 12 3 Output : 5 1 2 12 3 answer 6 Edited by author 12.12.2018 21:22 |
| Who knows what is the test 7? | David Yin | 1005. Stone Pile | 12 Mar 2019 20:15 | 4 |
Who knows what is the test 7? I failed at this test. [code deleted] Edited by moderator 29.01.2022 18:45 6 1 2 3 4 100 100 Will fail this program The solution is not correct |
| AC hint | gdh | 1234. Bricks | 12 Mar 2019 18:47 | 2 |
Problem should have weak tests if you got AC xD |
| Tests and Answers | Felix_Mate | 1984. Dummy Guy | 12 Mar 2019 00:04 | 2 |
for n:=1 to 50 do : 1 2 2.15470053837925 2.41421356237309 2.70130161670408 3 3.30476487096249 3.61312592975275 3.92380440016309 4.23606797749979 4.54946553288422 4.86370330515627 5.17858146886038 5.49395920743493 5.80973434474413 6.12583089548301 6.44219115175181 6.75877048314363 7.07553382097426 7.39245322149966 7.7095061398084 8.02667418333227 8.34394219610391 8.66129757554039 8.97872975555948 9.29622981055875 9.61379014847791 9.93140427038051 10.2490665803026 10.5667722335056 10.8845170143696 11.2022972373783 11.520109666252 11.8379514474594 12.155820055209 12.4737132456699 12.7916290186635 13.109565585441 13.4275213414455 13.7454948431824 14.0634847884921 14.3814899996548 14.6995094088628 15.0175420456841 15.3355870262037 15.6536435435869 15.9717108598527 16.2897882986785 16.6078752390897 16.9259711099087 pi = 3.14159265; alf = (n - 2) * 180 / (2 * n); ans = 1. + 1. / cos((alf * pi) / 180); cout << ans; |
| What is TLE at test 8?? | Iqramul Islam | 1131. Copying | 11 Mar 2019 01:48 | 1 |
|
| c++ code to flowchart | Izzat | | 10 Mar 2019 18:13 | 1 |
как перевести код под с++ в блок схему |
| why wrong answer? Pascal version | pizza_hunter | 1001. Reverse Root | 10 Mar 2019 13:20 | 1 |
This is my code ----------------------------------------- var j,i: longint; a: array[1..100000000] of real; begin i:=1; while not EOF do begin read(a[i]); i:=i+1; end; for j:=i-1 downto 1 do writeln(sqrt(a[j]):0:4); end. ----------------------------------------- Why is it wrong? can anyone please explain? thanks a lot Edited by author 10.03.2019 13:21 |
| why show me wrong answer for this problem of 1001?? My compiler give me a right answer.. | Amit_guha | 1001. Reverse Root | 10 Mar 2019 13:16 | 3 |
#include<bits/stdc++.h> #include<math.h> using namespace std; int main() { long long int i,j,k,s; double a,b,c,d; scanf("%lld %lld %lld %lld",&i,&j,&k,&s); if(s>=0) { d=sqrt(s); printf("%.4f\n",d); } if(k>=0) { c=sqrt(k); printf("%.4f\n",c); } if(j>=0) { b=sqrt(j); printf("%.4f\n",b); } if(i>=0) { a=sqrt(i); printf("%.4f\n",a); } return 0; } Why do you think there are only four numbers in input? Why do you think a number can be negative? If you are new to OJ system... The point is, the system will input any case that satisfies its question, not only the sample input. Therefore, there might not be only 4 numbers for you to consider. It may input 100 numbers, which your code obviously cannot give the correct output. |
| WA Test 15 | arclite | 1182. Team Them Up! | 9 Mar 2019 18:37 | 1 |
can anyone send me a test please? semenanufriev@gmail.com |
| Good problem (there is hint inside) | medegor44 | 1755. Cake | 6 Mar 2019 15:44 | 1 |
Easy to solve with linear programming |