답안 #120330

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
120330 2019-06-24T08:15:51 Z 임유진(#2951) 통행료 (IOI18_highway) C++14
6 / 100
138 ms 6240 KB
#include "highway.h"
#include<vector>

using namespace std;

#define MAXN 90005

int N, A, B, d;

int f(int l, int r){
	vector<int> w(N-1, 0);
	for(int i=l+r>>1; i<r; i++) w[i]=1;
	int t=(ask(w)-(long long)A*d)/(B-A);
	if(t==0) return f(l, l+r>>1);
	if(t==d) return f(l+r>>1, r);
	return (l+r>>1)+t-d;
}

void find_pair(int n, vector<int> U, vector<int> V, int a, int b) {
	N=n;
	A=a;
	B=b;
	vector<int> w(N-1, 0);
	d=(int)(ask(w)/A);
	int t=f(0, N-1);
	answer(t, t+d);
}

Compilation message

highway.cpp: In function 'int f(int, int)':
highway.cpp:12:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  for(int i=l+r>>1; i<r; i++) w[i]=1;
            ~^~
highway.cpp:14:24: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  if(t==0) return f(l, l+r>>1);
                       ~^~
highway.cpp:15:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  if(t==d) return f(l+r>>1, r);
                    ~^~
highway.cpp:16:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  return (l+r>>1)+t-d;
          ~^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 632 KB Output is correct
2 Correct 45 ms 832 KB Output is correct
3 Correct 43 ms 2044 KB Output is correct
4 Correct 130 ms 2416 KB Output is correct
5 Correct 103 ms 5260 KB Output is correct
6 Correct 138 ms 2424 KB Output is correct
7 Correct 120 ms 6240 KB Output is correct
8 Correct 105 ms 2420 KB Output is correct
9 Correct 110 ms 2688 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 324 KB Output is incorrect: {s, t} is wrong.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 424 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 424 KB Incorrect
2 Halted 0 ms 0 KB -