11355 - Cool Points

All about problems in Volume 113. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Piklu_sust
New poster
Posts: 23
Joined: Fri Sep 01, 2006 10:17 am
Location: CSE, SUST

11355 - Cool Points

Post by Piklu_sust »

I got WA infinite times in this problem.
Can anybody help me who got ACC?
I post my code to verify why this got WA.

Code: Select all

Cut After ACC
I assure that I will cut my code just see the accepted.
Thanks in advance.
Last edited by Piklu_sust on Sat Dec 01, 2007 5:17 pm, edited 1 time in total.
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

check this

Post by sohel »

Input

Code: Select all

1
4 1000
-5 -81 -45 27
27 -91 36 4
-21 18 -16 95
-69 67 -12 -99
Output

Code: Select all

Case 1: 31.47%
Piklu_sust
New poster
Posts: 23
Joined: Fri Sep 01, 2006 10:17 am
Location: CSE, SUST

Post by Piklu_sust »

Thanks again sohel vai for his great test case.
Angle computation was the problem of my code.
Thanks again BOSS.
tanaeem
New poster
Posts: 26
Joined: Mon Mar 12, 2007 6:58 pm
Location: BUET
Contact:

Post by tanaeem »

I have got WA several times.
Can someone please help me with some test case.
Or you might check my code.


Code: Select all

removed after AC
Last edited by tanaeem on Sun Dec 23, 2007 6:53 pm, edited 1 time in total.
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Post by sohel »

Check your output for this case

Input

Code: Select all

1
8 1000
16 90 35 42
64 -46 48 5
-6 -93 1 48
-56 66 40 -76
26 37 -23 -38
33 39 -15 58
73 21 86 -45
77 97 -73 12
Output should be

Code: Select all

Case 1: 0.00%
Hope it helps.
lalalalalala
New poster
Posts: 1
Joined: Tue Mar 04, 2008 2:16 am

Post by lalalalalala »

I'm getting WA.
Can anyone tell me what I'm doing wrong.
It gives the right answer for all test cases that were posted.
Thanks,

Code: Select all


#include <iostream>
#include <cstdio>
#include <map>
#include <cmath>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)

long double calc(int x,int y){
    return atan2((long double)y,(long double)x);
}

const long double PI=4.0*atan((long double)1.0);

int main(){
    int TC;
    cin>>TC;
    for(int tc=1;tc<=TC;tc++){
        int N,R;
        cin>>N>>R;
        map<long double,int> segs;
        FOR(i,0,N){
            int x1,y1,x2,y2;
            cin>>x1>>y1>>x2>>y2;
            long double a=calc(x1,y1);
            long double b=calc(x2,y2);

            if(a>b)swap(a,b);
            if(b-a<=PI){
                segs[a]++;
                segs[b]--;
            }else{
                segs[-PI]++;
                segs[a]--;
                segs[b]++;
                segs[PI]--;
            }
        }
        int a=0;
        long double last=-PI;
        long double total=0;
        for(map<long double,int>::iterator it=segs.begin();it!=segs.end();++it){
            if(a>0)total+=it->first-last;
            a+=it->second;
            last=it->first;
        }
        long double ret=2*PI-total;
        printf("Case %d: %.2Lf%%\n",tc,ret/(2*PI)*100.0);
    }
    return 0;
}

[/i]
ilonpilaaja
New poster
Posts: 2
Joined: Sun Apr 20, 2014 7:05 pm

Re: 11355 - Cool Points

Post by ilonpilaaja »

Could anyone provide AC output for this:

Code: Select all

13
7 4
1.31781388747 1.93700402056 -0.98791269601 -1.82128810849
-1.30461986717 2.1488598996 0.00504836150023 3.3583901621
-0.149773400128 1.04488284216 -3.07233692162 0.366515298786
1.06976357413 0.633474693675 -2.87585927018 -0.902192024081
-1.22322532009 1.96268508678 -2.79597965284 0.488600385086
-1.70368213351 1.33434241086 2.93126582535 1.63566277403
0.543709501701 0.0879474382556 -0.608600492136 -0.910364103781
7 5
-1.83073762157 -1.264270018 0.557239709563 -4.17690813716
-1.76187105518 1.09049093523 1.86625374187 -0.538389979468
-2.08870480925 -2.76513226328 0.441574115318 0.938135692325
-3.90154367628 0.170885313995 -1.34365500006 2.72414657366
-0.57496988554 0.0442419219584 -1.50539413404 0.831300217731
2.28761313891 -1.80503113431 -0.12518441985 1.43995738885
-0.784162195485 1.53857783709 3.02897207924 -0.878794080777
7 5
-0.599188198012 -0.860059076933 -1.13483394119 1.63661096152
-1.32791806286 3.46010042918 1.25197616717 -0.546000402724
0.801070623475 1.38971842593 -0.264739346939 -0.550338027497
3.93602524965 -1.03257958398 1.82931831567 3.79037510074
2.2225600514 -1.87075361401 -2.84185191491 0.435106955033
1.26390342034 -3.18885110443 3.19489492434 -1.46264976895
0.313851565897 1.60940052169 4.25258619645 1.15081069889
7 5
-0.746560000233 -3.08209549185 1.49918199225 2.79187646874
-0.109491750287 -0.493851291991 1.14486937431 -0.379356228394
1.31563535562 -0.505105170552 2.13603445198 -0.0315723284774
-0.692110768149 0.688768146597 1.52365117024 2.57676305388
2.81543021347 3.35839446228 -0.613663544765 -0.326841967782
0.204257630176 4.44075638143 -0.93026195322 1.37603494412
-0.0544350120078 -0.847085669236 -1.28332072711 0.595973806013
7 2
-0.755326109846 -0.309719457256 -1.24538439059 -0.726079008376
1.28533989801 0.0478245316113 -0.699438186275 -1.08636176898
-1.28964631811 0.504391760188 1.12499004711 -0.480429622758
0.219912655853 -1.47952185853 0.890981544753 0.390184036033
0.836794274201 0.579299475301 0.933367352489 0.978644571017
-0.809616931349 0.0645924452937 0.64620356677 -0.329509668529
0.791248579269 -0.431992869529 0.243513728154 -0.464116828585
7 1
-0.230805337349 -0.443541312902 0.355375044373 0.35172230216
-0.0774116308525 0.493971091673 0.305162818336 0.39607531393
-0.494305897651 -0.0752441329795 0.497713967254 0.0477577930813
-0.499357949364 -0.0253305824431 -0.241224212077 0.437962189587
0.162815982996 0.472748300559 -0.31227413583 -0.39049310377
0.0441705646344 0.498045139741 -0.425793686976 0.262106345081
-0.10745871667 -0.488316110948 -0.422310940016 0.267681657838
7 2
1.31097749945 0.0795343410567 -1.05865224416 0.179082798654
-0.466355047708 -0.86777822554 -0.584625347749 -0.884211664349
-0.946952202898 -0.783964989129 0.948336998271 0.803317316104
-0.734514378796 0.0301531840147 -1.09410507031 -0.894058774236
0.141176112556 0.523702450656 -0.933008845553 0.273839001341
-1.02925901556 -0.355526707351 -0.998180641151 0.28097631914
-0.664996622139 -0.602704061693 0.00795614716991 0.755047608612
7 4
0.509053450929 0.802034691916 1.65594451289 -0.0426524583125
0.587068498497 3.07059689197 -0.602457926656 -0.393328549508
-1.26220469376 0.501612873926 0.307768559971 2.77414561071
-1.6520412049 2.04206773956 -0.2403795301 -1.37632265087
-0.269307987493 -0.670488533872 -1.98797112825 -1.61748698024
0.296767348222 -2.35792929 0.911303522313 -0.725999857462
-0.293869520931 -2.42671317837 -0.248206292549 -1.20699102485
7 1
0.0609066498688 -0.496276515666 -0.240702979327 0.438248874206
-0.386668764174 -0.316997266254 0.0845919834554 -0.492792244597
-0.443877000331 -0.230159094057 -0.357844721102 0.34920932917
0.432194239091 -0.251412290265 0.126558321828 0.48371788387
-0.311681706487 0.390966128765 -0.494666649548 0.0728347844465
-0.49557777571 0.0663526052381 -0.158024663241 0.474371379625
-0.101942013807 -0.489497523815 0.482086951675 0.132635481771
7 4
-1.09406758623 -3.12454258523 0.27445914637 3.0059605834
0.5767960035 -0.372626228376 -0.512413510738 -1.38274693002
0.616442278371 -3.24333687615 1.27450949414 0.605824133095
2.55429987584 0.850346978156 -0.439805160619 0.690664922953
-1.20322088823 2.95079073205 -0.968553900169 1.07373006617
0.818624776545 0.800658935231 -1.44336809317 -0.913107091811
-0.775565262252 -0.336594999375 -1.35179641613 0.131128407305
7 1
0.498489579799 0.0388347631843 0.454113040124 0.209239926374
-0.47752578672 -0.148219846907 -0.40293725037 0.296043193241
0.115010904183 0.486592737224 0.480949882408 0.136701172679
0.180303327845 0.466358992588 -0.0555691832088 0.496902471193
0.498957978802 -0.0322635303362 -0.291867748531 0.405971941601
-0.327718480533 -0.377624942923 0.236522427235 -0.440519172585
0.122374493714 -0.484793237668 -0.122911444612 0.48465738082
7 3
0.496782669054 0.141181102456 1.0284282905 1.14494867194
-0.283609110483 2.29488138971 -1.85397887762 -0.946541489627
-0.525298065629 -0.563939356198 1.27164894333 -0.929505715501
-1.74680352493 1.33888555693 0.38217310946 1.53619651591
0.457682781691 1.6787442252 -2.34802229291 0.6688715724
-0.604852988516 -0.061806994757 -0.831195844805 -1.21285697263
1.84899099498 1.32810837122 1.2936550411 -1.43044483448
7 5
1.8589155056 0.349095930068 1.66844814962 3.64287892127
3.62593893667 -1.85994811627 2.11031568496 -1.76290135451
1.15850262611 -0.209684911064 -2.84458719211 -1.74699608375
-3.69139581213 0.413259940387 -2.11519847906 0.058364304718
2.76978732851 -0.698765677775 0.376113290342 -3.02802719082
-2.41839217105 -3.30271258696 -1.38844994336 0.758582014163
1.09680742414 -2.04300442236 -1.37297895148 2.79985889736
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11355 - Cool Points

Post by brianfry713 »

Check input and AC output for thousands of problems on uDebug!
ilonpilaaja
New poster
Posts: 2
Joined: Sun Apr 20, 2014 7:05 pm

Re: 11355 - Cool Points

Post by ilonpilaaja »

Thanks Brian, but the Toolkit said "No Output" the last time I checked -- maybe broken link on the server side or something. Anyways I got AC, and attaching the correct output for the above testcase

Code: Select all

Case 1: 10.78%
Case 2: 12.26%
Case 3: 3.82%
Case 4: 0.00%
Case 5: 34.26%
Case 6: 2.13%
Case 7: 37.80%
Case 8: 20.20%
Case 9: 9.19%
Case 10: 0.00%
Case 11: 16.13%
Case 12: 7.41%
Case 13: 9.79%
Post Reply

Return to “Volume 113 (11300-11399)”