如何在P1001 A+B Problem中凑齐RE,TLE,AC,WA,MLE

· · 算法·理论

这不是题解!!!

挑战在P1001 A+B Problem中凑齐AC,WA,RE,TLE,MLE

using namespace std;

int main() { auto now = chrono::high_resolution_clock::now(); auto micros = chrono::time_point_cast<chrono::microseconds>(now); long seed = micros.time_since_epoch().count();

mt19937 gen(seed);
uniform_int_distribution<> dis(0, 4);
int random = dis(gen);

int a, b;
cin >> a >> b;

if (random == 0) {
    cout << a + b << endl;
} else if (random == 1) {
    cout << a + b + 1 << endl;
} else if (random == 2) {
    while (true) {}
} else if (random == 3) {
    vector<char*> memory_blocks;
    try {
        while (true) {
            char* block = new char[100000000];
            memory_blocks.push_back(block);
        }
    } catch (const bad_alloc& e) {
        cout << a + b << endl;
    }
} else {
    int x = 0;
    int y = 1 / x; 
    cout << y << endl;
}

return 0;

}


# 再次申明:这不是题解!!!!!
# 这不是题解!!!!!
# 这不是题解!!!!!