QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#869569#10. 卡常数yangcanningCompile Error//C++23236b2025-01-25 11:22:592025-01-25 11:23:00

Judging History

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

  • [2025-01-25 11:23:00]
  • 评测
  • [2025-01-25 11:22:59]
  • 提交

answer

#include"bits/stdc++.h"
using namespace std;
constexpr int square(int x) {
    return x * x;
}
//constexpr int result = square(100);
constexpr bool result[100000000] = { square(100) };
int main() {
    cout << result << endl;
}

詳細信息

answer.code:7:44: error: narrowing conversion of ‘10000’ from ‘int’ to ‘bool’ [-Wnarrowing]
    7 | constexpr bool result[100000000] = { square(100) };
      |                                      ~~~~~~^~~~~