QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#709204#9246. Dominating PointSSAABBEERRCompile Error//C++201.2kb2024-11-04 12:52:552024-11-04 12:52:55

Judging History

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

  • [2024-11-22 18:38:25]
  • hack成功,自动添加数据
  • (/hack/1238)
  • [2024-11-04 12:52:55]
  • 评测
  • [2024-11-04 12:52:55]
  • 提交

answer

#include<bits/stdc++.h>
#define lowbit(x) (x & (-x))
#define endl "\n"
#define ll long long
// #define int long long
using namespace std;
#define pii pair<int, int>
#define rep(i, a, b) for(int i = a; i <= b; i ++ )
#define pre(i, a, b) for(int i = a; i >= b; i -- )
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
mt19937_64 rnd(time(0));
const int N = 1e6 + 10;
int n, m, k;
string s[5050];
int a[10], b[10];
bitset<5050>dis[5050];
void solve()
{
    cin >> n;
    rep(i, 1, n)
    {
        cin >> s[i];
        s[i] = " " + s[i];
        rep(j, 1, n)
        {
            if(s[i][j] == '1')
            {
                dis[i][j] = 1;
            }
        }
    }
    rep(i, 1, n)
    {
        dis[i][i] = 1;
        rep(j, 1, n)
        {
            if(s[i][j] == '1') dis[i] |= dis[j];
        }
    }
    vector<int>ans;
    pre(I, n, 1)
    {
        if(dis[i].count() == n) ans.push_back(i);
    }
    if(ans.size() < 3)
    {
        cout << "NOT FOUND" << endl;
    }
    else
    {
        rep(i, 0, 2) cout << ans[i] << " ";
    }
}
signed main()
{
    IOS;
    int _;
    _ = 1;
    // cin >> _;
    while(_ -- )
    {
        solve();
    }
	return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:43:16: error: ‘i’ was not declared in this scope
   43 |         if(dis[i].count() == n) ans.push_back(i);
      |                ^