QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#380370#8566. Can We Still Qualify For Semifinals?ucup-team1134#Compile Error//C++231.7kb2024-04-07 02:10:282024-04-07 02:10:29

Judging History

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

  • [2024-04-07 02:10:29]
  • 评测
  • [2024-04-07 02:10:28]
  • 提交

answer

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    vector<pair<int,int>> S;
    vector<int> X(10);iota(all(X),0);
    for(int q=0;q<9;q++){
        for(int i=0;i<5;i++) S.push_back(mp(X[i],X[9-i]));
        rotate(X.begin()+1,X.begin()+9,X.end());
    }
    int Q;cin>>Q;
    while(Q--){
        int N;cin>>N;
        string SS;cin>>SS;
        bool ans=false;
        
        vector<int> def(10);
        for(int i=0;i<si(SS);i++){
            if(SS[i]=='1'){
                def[S[i].fi]++;
            }else{
                def[S[i].se]++;
            }
        }
        vector<int> P(10);iota(all(P),0);
        do{
            if(P[0]) break;
            auto sc=def;
            for(int i=N;i<45;i++){
                if(P[S[i].fi]<P[S[i].se]) sc[S[i].fi]++;
                else sc[S[i].se]++;
            }
            int mak=0;
            for(int i=1;i<10;i++) if(sc[i]>sc[0]) mak++;
            if(mak<=3){
                ans=true;
                break;
            }
            
        }while(next_permutation(all(P)));
        
        if(ans) cout<<"YES\n";
        else cout<<"NO\n";
    }
}


详细

In file included from /usr/include/c++/13/string:43,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from answer.code:4:
/usr/include/c++/13/bits/allocator.h: In destructor ‘constexpr std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl()’:
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to ‘always_inline’ ‘constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = int]’: target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
  133 |       struct _Vector_impl
      |              ^~~~~~~~~~~~