Блог пользователя ReTai-Hieu

Автор ReTai-Hieu, история, 3 года назад, По-английски

Watch this video first Video

#include<bits/stdc++.h>
#define ii pair <int,int>
#define fi first
#define se second
#define int long long
#define double long double
#define endl '\n'
using namespace std;

const int maxN = 5000;
// const int maxN = 1e5 + 10;

int dp[maxN][maxN];

signed main(){
    //freopen("input.INP", "r", stdin);
    //freopen("output.OUT", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    return 0;
}

I use Macos Monterey 12.6.2, Command Line Tools for Xcode 14, and Homebrew GCC 12.2.0. When I declare the array too large, the machine will automatically restart. My question is is this a bug or a feature, because when I try it on Window 11 it still shows an error, not a restart. And as far as I know, when we restart the computer with code, we need admin permission sudo shutdown -r now but if we use this way, we don't need it.

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

if this isn't fake i will never use a mac.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

it's not a bug, it's a feature for Apple computers to refuse to run anything that is not written in Swift (or Objective-C)

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +12 Проголосовать: не нравится

Instead of having a +10 minutes MLE penalty, now you will only have a +5 minutes penalty for restarting your mac. fair enough!

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

However, on my mac, the program with maxN=1e5+10 works normally. It seems that my computer will automatically kill programs which require too much memory, as I saw [1] 8735 killed /Users/…/xxx in the terminal when I ran a program.

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Use Linux(arch btw) instead

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

This did happen with me too,in between a contest :(