UNAC 原因总结

· · 个人记录

本博客经验更新,前期内容可能较少,你也可以帮助博主添加你的意见!

大家在看到 \color{white}\colorbox{red}{WA}\colorbox{purple}{RE}\colorbox{#000060}{TLE} 而且怎么调都调不对时,有没有过一种想砸电脑的感觉?

这篇博客助力你 \color{white}\colorbox{green}{AC}!

常见の错误法

\text{Overall}

(本区放的是怎么错都很有可能的)

  1. 读错题!(特别是外文题)

  2. 算法想错!(特别是 n\le10^3 然后你想了个 O(n) 做法的,大概率假的)

  3. 细节没想到!(很容易 \text{FST}!)

  4. 交错题!

  5. 多测没清空!

  6. 输入错!

  7. 输出格式错!

\color{white}\colorbox{red}{WA}

(其实这里的也有可能错成 \color{white}\colorbox{purple}{RE} 或 \color{white}\colorbox{#000060}{TLE})

  1. 不开 long long 见祖宗!!!

  2. 模数看错,10^9+7\to998244353。

  3. 什么地方忘了 +1 或 -1。

  4. 1<<x \to (1ll)<<x

  5. 给一个长度为 2n 的序列 a,for(int i=1;i<=n;i++)cin>>a[i];

  6. UB!UB!UB!

  7. 二分的时候,最后答案是 l 还是 r?

  8. for(int j=1;j<=n;i++)(实际上是上一种的特殊情况)

  9. long long x=31415926535;printf("%d",x);

  10. 类似双关键字的东西,第一关键字最小的情况下有没有进一步保证第二关键字最小?

  11. 输出没判无解(无解标志不是 \texttt{-1} 或题目指定的内容)?

\color{white}\colorbox{purple}{RE}

  1. 数组开够了吗?(可能是 \color{white}\colorbox{red}{WA})

  2. 爆栈了吗?

  3. int a[N];for(int i=1;i<=N;i++)a[i]=xxx;(上一种的特殊情况)

  4. assert 炸了吗?

  5. scanf 加 & 了吗?

\color{white}\colorbox{#000060}{TLE}

  1. 死循环/死递归了吗?

  2. 复杂度假了吗?

  3. 常数被卡了?

  4. bfs/dijkstra 的时候你的 vis 数组怎么标的?

  5. 清空的时候用了 memset,然后题目没限制数据组数(只限制了 \sum n)

  6. cerr 炸了吗?

  7. ios 优化之后用 endl 了吗?

  8. char 数组少用 strlen!!!

  9. for(int i=n;i>=1;i++)

\color{white}\colorbox{#000060}{MLE}

  1. 数组开太大了?

  2. 死递归了?

\color{white}\colorbox{yellow}{CE}

  1. 你编译代码了吗?

  2. 是不是用了某些禁用的东西?

  3. 选错语言了吗?