QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#422380#8724. SeptemberPhysics212303Compile Error//C++17672b2024-05-27 13:28:122024-05-27 13:28:12

Judging History

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

  • [2024-05-27 13:28:12]
  • 评测
  • [2024-05-27 13:28:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int solve(int n,int m,vector<int> f,vector<vector<int> > s){
  int c=0;
  vector g(m,vector<set<int> >(n));
  for(int i=0;i<m;i++)
  vector<set<int> > v(m);
    for(int j=1;j<n;j++)
      g[i][f[j]].emplace(j),v[i].emplace(f[j]);
  vector<double> a(m);
  for(int i=0;i<n-1;i++){
    bool b=true;
    for(int j=0;j<m;j++){
      a[j]+=sin(s[j][i]);
      g[j][f[s[j][i]]].erase(s[j][i]);
      if(g[j][f[s[j][i]]].empty())
        v[j].erase(f[s[j][i]]);
      if(!g[j][s[j][i]].empty())b=false;
      b&=v[j].empty();
    }
    for(int j=1;j<m&&b;j++)
      b&=a[j]==a[j-1];
    c+=b;
  }
  return c;
}

详细

answer.code: In function ‘int solve(int, int, std::vector<int>, std::vector<std::vector<int> >)’:
answer.code:9:9: error: ‘i’ was not declared in this scope
    9 |       g[i][f[j]].emplace(j),v[i].emplace(f[j]);
      |         ^
answer.code:9:29: error: ‘v’ was not declared in this scope
    9 |       g[i][f[j]].emplace(j),v[i].emplace(f[j]);
      |                             ^
answer.code:17:9: error: ‘v’ was not declared in this scope
   17 |         v[j].erase(f[s[j][i]]);
      |         ^
answer.code:19:10: error: ‘v’ was not declared in this scope
   19 |       b&=v[j].empty();
      |          ^