16777mt16's blog

By 16777mt16, history, 12 months ago, In English

i am looking for a website, that can detect whether a program(like the following one) is completed by ai or not. are there any good websites or apps? thank you very much!

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
using ull = unsigned long long;
 
/*
n=奇数,需要s=t;  
n=偶数长度时**,分解为 n 刨掉每个2因子这么多的块。  
XOR 操作就做同一组可逆线性变换:t = ms 对所有块内对应位置同时生效,且 m 必须可逆。  
存在可逆 m 使得 ms = t 就是s 的行空间要和 t 的行空间一样
那么我们只需要找到所有块,做 GF(2) 下的高斯消元,再把 s 的每个块在 t 的基下消元,全部化为0。
同理把 t 的每个块在 s 的基下也能化为0,代码比较好写。
*/
 
struct P {
    vector<ull> d;
    P(int len = 0) : d((len + 63) >> 6) {}
    void Xor(const P &o) {
        for (int i = 0; i < (int)d.size(); i++)
            d[i] ^= o.d[i];
    }
    bool chk(int p) const {
        return (d[p >> 6] >> (p & 63)) & 1;
    }
    void st1(int p) {
        d[p >> 6] |= (1ULL << (p & 63));
    }
    bool ck0() const {
        for (ull w : d) if (w) return 0;
        return 1;
    }
    int mx() const {
        for (int i = (int)d.size() - 1; i >= 0; i--) {
            if (d[i]) {
                int lz = __builtin_clzll(d[i]);
                return i * 64 + (63 - lz);
            }
        }
        return -1;
    }
};
int n, bl, m;
vector<P> sb, tb;
vector<pair<int, P>> S, T;
void calS() {
    vector<P> tmp = sb;  
    S.clear();
    for (auto &v : tmp) {
        for (auto &b : S) {
            if (v.chk(b.fi)) v.Xor(b.se);
        }
        if (v.ck0()) continue;
        int h = v.mx();S.emplace_back(h, v);
        sort(S.begin(), S.end(),[](auto &l, auto &r){return l.fi > r.fi;});
    }
}
void calT() {
    vector<P> tmp = tb;
    T.clear();
    for (auto &v : tmp) {
        for (auto &b : T) {
            if (v.chk(b.fi)) v.Xor(b.se);
        }
        if (v.ck0()) continue;
        int h = v.mx();
        T.emplace_back(h, v);
        sort(T.begin(), T.end(),[](auto &l, auto &r){ return l.fi > r.fi;});
    }
}
bool chkT() {
    for (auto &cr : sb) {
        P v = cr;
        for (auto &b : T) {
            if (v.chk(b.fi)) v.Xor(b.se);
        }
        if (!v.ck0()) return 0;
    }
    return 1;
}
bool chkS() {
    for (auto &cr : tb) {
        P v = cr;
        for (auto &b : S) {
            if (v.chk(b.fi)) v.Xor(b.se);
        }
        if (!v.ck0()) return 0;
    }
    return 1;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T; 
    cin >> T;
    while (T--) {
        string s, t;
        cin >> n >> s >> t;
        if (n & 1) {
            cout << (s == t ? "Yes\n" : "No\n");
            continue;
        }
        if (s == t) {
            cout << "Yes\n";
            continue;
        }
        int k = __builtin_ctz(n);
        bl = 1 << k,m = n >> k;
        sb.assign(bl, P(m));
        tb.assign(bl, P(m));
        for (int i = 0; i < bl; i++) {
            for (int j = 0; j < m; j++) {
                if (s[i*m+j] == '1') sb[i].st1(j);
                if (t[i*m+j] == '1') tb[i].st1(j);
            }
        }
        calS(),calT(),	cout << (chkT() && chkS() ? "Yes\n" : "No\n");
    }
    return 0;
}
  • Vote: I like it
  • -9
  • Vote: I do not like it

»
12 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

I dont know a program which is wrote to check this, but i can recommend you to use AI :p

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    thanks, but i'm currently in the computer room of my school, and i didn't get my phones so i can't use ai :(

»
12 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

If there was such a website, you can rest assured google and openai scientists would train their model on it until it did not work anymore.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The answer might be clear.

Comparison