QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#460173#5531. ICCfryanCompile Error//C++201.4kb2024-07-01 04:17:112024-07-01 04:17:12

Judging History

你现在查看的是测评时间为 2024-07-01 04:17:12 的历史记录

  • [2024-07-01 04:29:09]
  • 管理员手动重测本题所有提交记录
  • [2024-07-01 04:17:12]
  • 评测
  • [2024-07-01 04:17:11]
  • 提交

answer

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include "icc.h"
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()

vector<int> gen(int cyc, int len) {
	vector<int> res; res.resize(len);
	for (int b = 0; b < len; b += cyc) {
		for (int i = b; i < min(len, b+cyc); i++) {
			res[i] = (b/cyc)%2;
		}
	}
	return res;
}

const int mxn = 1e2;
int aux1[mxn], aux2[mxn];

int send_query(vector<int> &a, vector<int> &b) {
	for (int i = 0; i < sz(a); i++) {
		aux1[i] = a[i];
	}
	for (int i = 0; i < sz(b); i++) {
		aux2[i] = b[i];
	}
	return query(sz(a), sz(b), aux1, aux2);
	
}

array<int,2> get_edge(vector<int> &a, vector<int> &b) {
	if (sz(a) == 1 && sz(b) == 1) {
		return {a[0], b[0]};
	}
	if (sz(a) < sz(b)) swap(a,b);
	vector<int> ra; ra.resize((sz(a)+1)/2);
	for (int i = 0; i < (sz(a)+1)/2; i++) {
		ra[i] = a[i];
	}
	
}

void run(int n) {
	vector<int> t1 = {1};
	vector<int> t2 = {2};
	cout << query(t1,t2) << "\n";
}

/*
signed main() {
		
	return 0;
}*/

Details

answer.code: In function ‘void run(int)’:
answer.code:68:23: error: cannot convert ‘std::vector<int>’ to ‘int’
   68 |         cout << query(t1,t2) << "\n";
      |                       ^~
      |                       |
      |                       std::vector<int>
In file included from answer.code:24:
icc.h:10:15: note:   initializing argument 1 of ‘int query(int, int, int*, int*)’
   10 | int query(int a, int b, int *A, int *B);
      |           ~~~~^
answer.code: In function ‘std::array<int, 2> get_edge(std::vector<int>&, std::vector<int>&)’:
answer.code:63:1: warning: control reaches end of non-void function [-Wreturn-type]
   63 | }
      | ^