Submission #875251

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

void solve(int subtaskid,int N){
    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.0 , f2 = r-(r-l)/3.0;
        if(query(1,f1)<=query(1,f2)){
            r = f2;
        }else l = f1;
    }
    double y2 = l;
    double m = (y2-y1);
    the_lines_are({round(m)},{round(y1)});
}

Compilation message

nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:23:25: warning: narrowing conversion of 'round(m)' from 'double' to 'int' [-Wnarrowing]
   23 |     the_lines_are({round(m)},{round(y1)});
      |                    ~~~~~^~~
nicelines.cpp:23:25: warning: narrowing conversion of 'round(m)' from 'double' to 'int' [-Wnarrowing]
nicelines.cpp:23:36: warning: narrowing conversion of 'round(y1)' from 'double' to 'int' [-Wnarrowing]
   23 |     the_lines_are({round(m)},{round(y1)});
      |                               ~~~~~^~~~
nicelines.cpp:23:36: warning: narrowing conversion of 'round(y1)' from 'double' to 'int' [-Wnarrowing]
# Verdict Execution time Memory Grader output
1 Correct 24 ms 432 KB Output is correct
2 Correct 25 ms 440 KB Output is correct
3 Correct 31 ms 432 KB Output is correct
4 Correct 25 ms 436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 436 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 600 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 600 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 432 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 600 KB Incorrect
2 Halted 0 ms 0 KB -