답안 #1065588

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1065588 2024-08-19T09:41:43 Z Unforgettablepl Park (JOI17_park) C++17
20 / 100
78 ms 464 KB
#include "park.h"
#include <bits/stdc++.h>
using namespace std;

static int Place[1400];

void strat1(int N) {
    for(int i=0;i<N;i++) {
        for(int j=i+1;j<N;j++) {
            Place[i]=Place[j]=1;
            if(Ask(i,j,Place))Answer(i,j);
            Place[i]=Place[j]=0;
        }
    }
}

void strat2(int N) {
    vector<int> order = {0,N-1};
    for(int i=0;i<N;i++)Place[i]=1;
    for(int i=1;i<N-1;i++) {
        int pos = 0;
        Place[i]=0;
        for(int jump=1024;jump;jump/=2) {
            if(pos+jump>=order.size())continue;
            if(Ask(0,order[pos+jump],Place))pos+=jump;
        }
        Place[i]=1;
        order.emplace(order.begin()+pos+1,i);
    }
    for(int i=0;i<N;i++)Place[i]=0;
    for(int i=1;i<N;i++)Answer(min(order[i],order[i-1]),max(order[i],order[i-1]));
}

void Detect(int T, int N) {
    if(T==1)strat1(N);
    else if(T==2)strat2(N);
}

Compilation message

park.cpp: In function 'void strat2(int)':
park.cpp:24:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |             if(pos+jump>=order.size())continue;
      |                ~~~~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 6 ms 464 KB Output is correct
3 Correct 6 ms 348 KB Output is correct
4 Correct 6 ms 464 KB Output is correct
5 Correct 6 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 75 ms 348 KB Output is correct
2 Correct 37 ms 348 KB Output is correct
3 Correct 45 ms 348 KB Output is correct
4 Correct 78 ms 344 KB Output is correct
5 Correct 75 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -