Submission #875250

# Submission time Handle Problem Language Result Execution time Memory
875250 2023-11-18T20:36:40 Z Ahmed57 Nicelines (RMI20_nicelines) C++17
0 / 100
28 ms 440 KB
#include <bits/stdc++.h>
#include "nice_lines.h"
using namespace std;

void solve(int subtaskid,int N){
    int x = 0;
    double l = -1000000000.0 , r = 1000000000.0;
    for(int x = 0;x<1000;x++){
        double f1 = l+(r-l)/3 , f2 = r-(r-l)/3;
        if(query(0,f1)<=query(0,f2)){
            r = f2;
        }else l = f1;
    }
    double y1 = l;
    l = -1000000000.0 , r = 1000000000.0;
    for(int x = 0;x<1000;x++){
        double f1 = l+(r-l)/3 , f2 = r-(r-l)/3;
        if(query(1,f1)<=query(1,f2)){
            r = f2;
        }else l = f1;
    }
    double y2 = l;
    double m = (y2-y1);
    the_lines_are({m},{y1});
}

Compilation message

nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:24:20: warning: narrowing conversion of 'm' from 'double' to 'int' [-Wnarrowing]
   24 |     the_lines_are({m},{y1});
      |                    ^
nicelines.cpp:24:20: warning: narrowing conversion of 'm' from 'double' to 'int' [-Wnarrowing]
nicelines.cpp:24:24: warning: narrowing conversion of 'y1' from 'double' to 'int' [-Wnarrowing]
   24 |     the_lines_are({m},{y1});
      |                        ^~
nicelines.cpp:24:24: warning: narrowing conversion of 'y1' from 'double' to 'int' [-Wnarrowing]
nicelines.cpp:6:9: warning: unused variable 'x' [-Wunused-variable]
    6 |     int x = 0;
      |         ^
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 440 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 436 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 432 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 436 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 428 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 436 KB Incorrect
2 Halted 0 ms 0 KB -