Submission #597253

# Submission time Handle Problem Language Result Execution time Memory
597253 2022-07-15T19:47:21 Z ThegeekKnight16 Nicelines (RMI20_nicelines) C++17
0 / 100
1 ms 336 KB
#include <bits/stdc++.h>
#include <nice_lines.h>
using namespace std;
typedef long double dd;

void solve(int subtask_id, int N)
{
    if (N == 1)
    {
        dd D = query(0.0, 0.0);
        int a, b;
        if (D == 0.0)
        {
            b = 0.0;
            
            int ini = -1e4 - 10; int fim = 1e4 + 10;
            while (ini < fim)
            {
                int m1 = ((fim - ini) / 3);
                int m2 = 2*m1;
                m1 += ini; m2 += ini;
                if (fim - ini <= 2)
                {
                    m1 = ini+1;
                    m2 = fim-1;
                }
                dd d1 = query((long double)1.0, (long double)m1);
                dd d2 = query((long double)1.0, (long double)m2);
                if (d1 == 0.0) 
                {
                    vector<int> respA, respB;
                    respA.push_back(m1); respB.push_back(b);
                    the_lines_are(respA, respB);
                }
                else if (d2 == 0.0)
                {
                    vector<int> respA, respB;
                    respA.push_back(m2); respB.push_back(b);
                    the_lines_are(respA, respB);
                }
                
                if (d1 <= d2) fim = m2;
                else if (d2 < d1) ini = m1;
            }
            vector<int> respA, respB;
            respA.push_back(ini); respB.push_back(b);
            the_lines_are(respA, respB);
        }
        else
        {
            vector<int> v;
            v[-1] = 0;
        }
    }
    else
    {
        return;
    }
}


/*int main()
{
    
}*/

Compilation message

nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:11:13: warning: unused variable 'a' [-Wunused-variable]
   11 |         int a, b;
      |             ^
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -