QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#500028#6730. CoolbitsMOUZ_donkCompile Error//C++201.5kb2024-07-31 21:24:422024-07-31 21:24:43

Judging History

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

  • [2024-07-31 21:24:43]
  • 评测
  • [2024-07-31 21:24:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int T, n;
int l[N], r[N],c[N], choose[N];
void solve(){
   cin>>n;
   int min1=143322333;
    for (int i = 1; i <= n; ++i){
         cin>>l[i]>>r[i];
         choose[i] = 0;
         if(min1>r[i])
            min1=r[i];
    }
    int mm;
    for(int i=1;i<=31;i++){
        if((1<<i)>=min1)
            mm=i;
    }
    int ans = 0;
    for (int i = mm+1; i >= 0; --i) {
//
//        if((1<<(i+1))<min1){
//            cout<<ans<<endl;
//            return 0;
//        }
        int flag = 1;
        for (int j = 1; j <= n && flag; ++j) {
            int minn = choose[j] | (1 << i);
            int maxx = choose[j] | ((1 << i+1) - 1);
            if (minn > r[j] || maxx < l[j])
            flag = 0;
        }
        if (flag) {
            for (int j = 1; j <= n; ++j)
                choose[j] |= 1 << i;
            ans |= 1 << i;
        }
        else {
            for (int j = 1; j <= n; ++j) {
                int minn = choose[j] | (1 << i);
                int maxx = choose[j] | ((1 << i+1) - 1);
e                    if (minn <= r[j] && maxx >= l[j] && minn <= l[j])
                        choose[j] |= 1 << i;
            }
//             if (minn <= r[j] && maxx >= l[j] && minn - 1 <= l[j])
//             ans &= ((1 << i)-1);
        }

    }
   cout<<ans<<endl;
}
int main ()
{
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    cin>>T;
    while (T--) {
    solve();
    }

    return 0;
}

详细

answer.code: In function ‘void solve()’:
answer.code:43:1: error: ‘e’ was not declared in this scope; did you mean ‘std::numbers::e’?
   43 | e                    if (minn <= r[j] && maxx >= l[j] && minn <= l[j])
      | ^
      | std::numbers::e
In file included from /usr/include/c++/13/bits/max_size_type.h:37,
                 from /usr/include/c++/13/bits/ranges_base.h:39,
                 from /usr/include/c++/13/bits/ranges_algobase.h:38,
                 from /usr/include/c++/13/bits/ranges_algo.h:38,
                 from /usr/include/c++/13/algorithm:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/numbers:122:27: note: ‘std::numbers::e’ declared here
  122 |   inline constexpr double e = e_v<double>;
      |                           ^