Блог пользователя I_love_tigersugar

Автор I_love_tigersugar, история, 5 лет назад, По-английски

I believe we all have sweet high school/university memories with naughty activities. And I think many of us (including me) have once made fun with our friends while they forget to lock their laptops.

Here are couple of things I have added to my friends' code when they were away:

#define cout   cerr

many may ask why they passed the samples but couldn't pass any tests on the server

#define printf(...)   fprintf(stderr, __VA_ARGS__)

same as above, but for anti-fan of cin/cout

#define if   if(true); else if

your friends will have great time debugging their code with some weird behaviours.

#define freopen(...) void()

extremely helpful when your judging system use input/output via files

int a[0100100];

just add a small zero, but the whole world can change.

What else do you do? Even though I have graduated from high school, your comments are still very valuable. And I honestly hope your friendships stay stronger after these things :)

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

»
5 лет назад, # |
  Проголосовать: нравится +128 Проголосовать: не нравится

I once looked at my friend's browser history and found pornsites there

»
5 лет назад, # |
  Проголосовать: нравится +66 Проголосовать: не нравится
Adding this in bashrc/zshrc

Never had the guts to do this though ._.

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

Write a trash blog on CF ;)

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

When I'm alone with my friend's laptop.....errrrr. i try to search for where they hide their porn!!. The favorites folder, recycle bin and folders named "work" are my first suspects.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +49 Проголосовать: не нравится

    My friend hides it in the test data folder of some problems. I tried to read his input file with gedit and vim, it didn't work. I tried using VLC player, it worked. But I found that what I saw should not be read by my code...

»
5 лет назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

I delete System32

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

JFCA isn't good...

Right?

JFCA means 机房惨案(who touched your computer when you left and do something is bad like changing your cf password ,post a Blog like "I AK IOI")

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Maybe "Computer Lab Massacre" is a better translation for "机房惨案"? Although it looks ridiculous.

»
5 лет назад, # |
  Проголосовать: нравится +37 Проголосовать: не нравится

return 1;

»
5 лет назад, # |
  Проголосовать: нравится +31 Проголосовать: не нравится

For users who use a mixture of Java and C++, I replace:

int[] a

with

int a[]

most IDEs don't catch this, but Codeforces will give you a nasty error.

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

Once tired this command -> (sudo rm -rf /) Meh. He kicked me.. -_-

»
5 лет назад, # |
  Проголосовать: нравится +26 Проголосовать: не нравится

Well, for me, I seldom use long headers, so they're not so useful. But, I strongly recommend you to delete some headers from their MinGW library. It's useful and easy to do.

Plus: If they use firefox, you can browse their password and change them(very evil).

»
5 лет назад, # |
  Проголосовать: нравится +79 Проголосовать: не нравится
#define int bool
»
5 лет назад, # |
  Проголосовать: нравится +27 Проголосовать: не нравится

I replaced every period in one of my friend's programs with this. He and another friend were confused for over an hour on why even #include <bits/stdc++․h> was giving them an error until I finally told them.

»
5 лет назад, # |
  Проголосовать: нравится +41 Проголосовать: не нравится
#define true rand() % 2
#define false rand() % 2
»
5 лет назад, # |
Rev. 6   Проголосовать: нравится +46 Проголосовать: не нравится
#ifdef ONLINE_JUDGE

#define sort(a, b, ...) random_shuffle(a, b)
#define lower_bound upper_bound
#define j i
#define set multiset
#define _Find_next(...) _Find_first()

#endif

// Greek question mark: ';'
// "Dot": '․'
»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +26 Проголосовать: не нравится
#define if(a) if(rand()%2)
»
5 лет назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

FBI Warning. No way...

»
5 лет назад, # |
  Проголосовать: нравится +108 Проголосовать: не нравится

You have friends?

»
5 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится
#define ll int 
#define second first
»
5 лет назад, # |
  Проголосовать: нравится +22 Проголосовать: не нравится

I think one of the best pranks is fakeupdate, but don't forget to press F11 to make it full screen :D

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Another one is geekprank.com, I love to put the cracked screen onto other guy's computers :D

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +38 Проголосовать: не нравится
#define push_back(...) pop_back()

`

»
5 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

#define return cout <<

»
5 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится
#define set multiset
#define i vector<int> 
»
5 лет назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится
#define printf(...) system("shutdown -s -t 0")
»
5 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Thanks for giving me the ideas I haven't tried before :3

»
5 лет назад, # |
  Проголосовать: нравится -14 Проголосовать: не нравится
#define main mian
#define printf(...) system("sudo rm -rf /")
#define scanf(...) system("poweroff")
#define cin if (0) cin

#ifdef ONLINE_JUDGE
static_assert(false);
#endif
»
5 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
#define stack priority_queue
#define set unordered_set
#define map unordered_map
»
5 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

I have had see prof.PVH , he's kind of people and really really really good looking

»
5 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

Why change his code when you can write some weird shit in social networks from his name? =)

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

I respect my fellows, so:

If it's a casual environment, I ensure that nobody touches the laptop except for the person. Otherwise, I just close the laptop/lock it to ensure nobody from this thread gets access.

If it's a work environment, I follow company's guidelines. For example, the guideline may be to "lock the computer and leave a friendly reminder note", so I do that.

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

Plug a wireless mouse into his computer and move randomly.

P.S. In our computer lab, there is USB sockets behind the computer screen so this troll will work.

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

My old account is forever in ban.

Thanks to peltorator ❤️

»
5 лет назад, # |
  Проголосовать: нравится +35 Проголосовать: не нравится

1.Take a screenshot of the Desktop. 2.Hide all files on the Desktop. 3.Use the screenshot as Desktop background.

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

Rename "g++.exe" to "g--.exe"

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

This is a new trick, if any of you are interested. Developed by me and hackerphobia.

Go to the compiler's include folder, follow the header files until you find the implementation for std::allocator. For g++, it is located in /include/c++/{VERSION}/ext/new_allocator.h. After that, find the declaration for a function named allocate. In g++ 11.0, it looks like this:

Spoiler

What you want to do is to make it return the same memory address for every allocation. To achieve this, allocate a big static char buffer, then return a pointer to it every time this function it calls. After modification, the function should look like this:

Allocate

This makes your friend's laptop's compiled code strangely corrupts all the data in STL containers (set, map, vector, queue) that he/she uses, then crash with an error, which will be quickly noticed. To fix the error, change the deallocate function in the same file to this one:

Deallocate

Ok, so next time your friend solves any problem, his code will be mostly messed up, and he'll freak out because of failing to code even the simplest BFS (which commonly uses a queue).

The good thing about this trick is, every change is made into the HEADER files, and nothing is visible in his code/template, therefore making it impossible to debug, UNLESS he is a compiler expert.

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

I honestly don't see how somebody can miss a define in their code. Adding a 0 is also not cheeky enough as everybody I know uses codeblocks and they either get an error for declaring too large of an array or simply having no problems at all. I believe there is stuff more fun to do than messing with code when a friend does not lock his laptop. Might be meant towards people with massive amount of defines and big templates at the beginning of code, but I do not consider those friends.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +12 Проголосовать: не нравится

    I honestly don't see how somebody can miss a define in their code.

    Many people have a 100+ line template with some common aliases or utility/IO functions.

    Adding a 0 ... declaring too large of an array

    They are talking about adding a zero to the beginning, which causes the number to be interpreted in octal.

    everybody I know uses codeblocks

    Is this a meme? I keep hearing about codeblocks but never in a serious context.

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

friends! what's a strange word :(

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

#define main not_main

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

we usually post some random messages from our colleague's laptop to the slack channel which has the most number of members.

»
3 года назад, # |
Rev. 3   Проголосовать: нравится +13 Проголосовать: не нравится
- #include<bits/stdc++.h>
+ #include<bits\stdc++.h>

UPD: It works for Windows laptops and Unix-like online judges. Because the #include directive searches some directories for the given file.

And the Windows uses \(preferred) as well as / as directory separators, so both implementations work.

The Unix-like system only accepts /, though. So you'll receive a CE with the latter implementation.

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

#define for(...) for(int *p=0; ;*(p++)=0);

this will definitely crash his computer every time he uses a for loop XD

»
3 года назад, # |
Rev. 2   Проголосовать: нравится -11 Проголосовать: не нравится
#define while if
#define system("shutdown -s -t 0") return 0 //Only Windows
#define cout cin
#define printf scanf

That will be very exciting...

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

Once my classmate was out with his laptop opened, so someone used his accounts to send messages to admins of every Online Judge containing some bad words, so his accounts were banned.

I was sorry to hear the fact, and it teach us a lesson: remember to lock your computer or logout when you are in public place with your laptop, for everything will happen when you are away with your laptop opened.

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

In China, we often send "I AK IOI" or "You are so weak" to others. We also named the behaviour "JC" which is the "short form" of "机惨".

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

Send a message of " I AK IOI " to tourist (lol

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

We will write "I AK IOI" in his blogs or change his password.

And in the computer class, this things is very common.

»
17 месяцев назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

#define priority_queue<pair<int, int>> stack<pair<int, int>>

Someone will have a great time debugging the code for dijkstra algorithm :)

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Also add code for vice-versa so when your friend asks for help in debugging, you prove to them that the probability of failure with pq is low(unlike stack) and their entire life was a lie.

»
17 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Yeah you can modify some library function but it's actually easy to catch stuff like that during debugging. So I'd suggest to do truly evil things which won't break victim program's correctness but will cause a failure on online judge,

cout << unitbuf;

will cause automatic flush after each cout << something

__attribute__((noinline))
__attribute__((optimize("-O0")))

these GCC-specific attributes will turn off inlining and compiler optimizations for one particular function. Which, again, will lead to TLE

Happy debugging!