QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#323059#147. FloppySkyanCompile Error//C++23991b2024-02-08 12:05:372024-02-08 12:05:38

Judging History

你现在查看的是最新测评结果

  • [2024-02-08 12:05:38]
  • 评测
  • [2024-02-08 12:05:37]
  • 提交

floppy

#include <bits/stdc++.h>
#include "floppy.h"
using namespace std;
void read_array(int subtask_id, const vector<int> &v) {
    string res = "";
    stack<int> t;
    for (int i = 0; i < v.size(); i++) {
        while (!t.empty() && t.back() <= v[i]) {
            res += '0';
            t.pop_back();
        }
        t.push_back(v[i]);
        res += '1';
    }
    save_to_floppy(res);
}
vector<int> g[200005];
vector<int> solve_queries(int subtask_id, int N, const string &bits, const vector<int> &a, const vector<int> &b) {
    vector<int> res(q), v;
    int n = bits.size(), q = a.size(), c = 0;
    for (int i = 0; i < q; i++) {
        g[b[i]].push_back(i);
    }
    for (int i = 0; i < N; i++) {
        while (bits[c] == '0') {
            v.pop_back();
            c++;
        }
        v.push_back(i);
        for (int w : g[i]) {
            res[w] = *lower_bound(v.begin(), v.end(), a[w]);
        }
        c++;
    }
    return res;
}


详细

floppy.code: In function ‘void read_array(int, const std::vector<int>&)’:
floppy.code:8:32: error: ‘class std::stack<int>’ has no member named ‘back’
    8 |         while (!t.empty() && t.back() <= v[i]) {
      |                                ^~~~
floppy.code:10:15: error: ‘class std::stack<int>’ has no member named ‘pop_back’
   10 |             t.pop_back();
      |               ^~~~~~~~
floppy.code:12:11: error: ‘class std::stack<int>’ has no member named ‘push_back’
   12 |         t.push_back(v[i]);
      |           ^~~~~~~~~
floppy.code: In function ‘std::vector<int> solve_queries(int, int, const string&, const std::vector<int>&, const std::vector<int>&)’:
floppy.code:19:21: error: ‘q’ was not declared in this scope
   19 |     vector<int> res(q), v;
      |                     ^
floppy.code:30:22: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’
   30 |         for (int w : g[i]) {
      |                      ^
floppy.code:30:25: error: forming reference to reference type ‘std::vector<int>&’
   30 |         for (int w : g[i]) {
      |                         ^
grader_floppy.cpp: In function ‘void my_fprintf(FILE*, const char*, ...)’:
grader_floppy.cpp:17:9: error: ‘exit’ was not declared in this scope
   17 |         exit(0);
      |         ^~~~
grader_floppy.cpp: In function ‘void my_fscanf(FILE*, int, const char*, ...)’:
grader_floppy.cpp:26:9: error: ‘exit’ was not declared in this scope
   26 |         exit(0);
      |         ^~~~
grader_floppy.cpp: In function ‘void save_to_floppy(const string&)’:
grader_floppy.cpp:51:5: error: ‘exit’ was not declared in this scope
   51 |     exit(0);
      |     ^~~~
grader_floppy.cpp: In function ‘int main(int, char**)’:
grader_floppy.cpp:91:15: error: ‘atoi’ was not declared in this scope
   91 |     int run = atoi(argv[1]);
      |               ^~~~