Submission #238946

# Submission time Handle Problem Language Result Execution time Memory
238946 2020-06-13T17:02:10 Z dolphingarlic Balloons (CEOI11_bal) C++14
0 / 100
180 ms 2528 KB
#include <bits/stdc++.h>
main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f",r);}}

Compilation message

bal.cpp:2:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f",r);}}
      ^
bal.cpp: In function 'int main()':
bal.cpp:2:57: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f",r);}}
                                                    ~~~~~^~~~~~~~~
bal.cpp:2:94: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f",r);}}
                                                                                         ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Expected double, but "24.0000004.16666749.0000001.84...4404768.74089582.0000000.515244" found
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Expected double, but "247294217.000000252735385.437663" found
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Expected double, but "213.0000000.0011740.0422540.09....8657601.2059430.8292274.000000" found
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 384 KB Expected double, but "123.000000122.002033121.000033...641037.00033736.00642835.000694" found
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 512 KB Expected double, but "213.000000212.001174211.000011...0376.000000375.000665374.000004" found
# Verdict Execution time Memory Grader output
1 Incorrect 49 ms 1016 KB Expected double, but "15399.00000015398.00001615396....03.0000005202.0000485199.000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 102 ms 1532 KB Expected double, but "7938.0000007937.0000317936.000...08.0000259907.0000009906.000025" found
# Verdict Execution time Memory Grader output
1 Incorrect 113 ms 1760 KB Expected double, but "5060.0000005059.0000495055.000...4386.0000574384.00000065.044708" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 152 ms 2040 KB Expected double, but "1874.0000001873.0001331872.000...248.0000308247.000000516.563114" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 2528 KB Expected double, but "2962.0000002961.0000842960.000...86.0000011485.0001671482.000000" found
2 Halted 0 ms 0 KB -