Submission #1042685

#TimeUsernameProblemLanguageResultExecution timeMemory
1042685vjudge1Meteors (POI11_met)C++17
74 / 100
6065 ms5972 KiB
/* ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣤⣶⣶⣶⣶⠦⠶⡶⢦⠤⠤⠤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣠⣴⣶⣿⣿⣿⣿⣿⣿⣽⣽⣿⣿⣿⣿⣿⣭⣽⣭⣯⡭⡈⢙⣽⣶⣤⣤⣄⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣶⣟⣟⣽⣾⣿⢿⣿⡿⣿⣿⣿⣿⣿⣿⣟⠟⡻⣿⣿⣟⣟⣟⣿⡻⠿⠿⠿⠿⣍⠉⠉⠉⠙⠛⠛⠒⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣶⣿⣿⣿⣿⡿⣾⣿⣯⣿⣿⣿⣽⣿⣷⣽⣿⣿⡿⣿⣿⣾⢿⣿⡷⣿⣿⣿⣿⣯⣭⡅⣠⣹⣢⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⡿⣿⣟⣽⣿⣿⣿⣻⣿⣟⣟⣿⣻⣿⣝⣿⣯⣿⣻⣻⣿⣿⣿⣿⡪⡻⣿⣿⣽⣿⣿⣯⣻⣿⣶⣿⣖⣓⡤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠿⢿⣿⣟⣿⣿⣻⣿⣿⣿⠿⣿⣿⡿⣿⣿⢿⣿⡯⣿⣛⣿⣕⣿⣿⡿⣿⣿⣷⢿⡿⣻⣿⣿⣿⢿⣿⣿⡻⣿⡷⠷⠯⠦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⡽⠹⠩⡝⡇⡿⢻⢻⢻⡛⣿⣹⣿⣿⣿⣿⣿⣽⣿⣯⣿⣿⣿⡿⣿⣿⣿⣿⣽⡿⣿⣯⣻⣿⣿⡿⣿⣿⣿⣿⣿⣝⡍⠩⠀⢘⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣏⣓⣂⣀⣀⠀⣜⣀⣀⠐⠐⠓⣞⠨⣿⠿⣗⣿⣿⣻⣿⣿⣽⣿⣿⣺⣿⣿⣿⣿⣻⣿⣿⣿⣝⢿⣛⠻⣻⣿⣟⣟⣿⣿⣿⣤⣐⣒⣚⣳⡀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⠟⠻⠽⢯⣌⣶⣿⠿⡡⢴⣾⠛⢀⣷⡉⡟⣷⢊⢘⢀⡙⣷⣾⣿⣿⣿⣿⣿⣿⢿⣿⢿⣿⡿⣿⣿⣽⢋⣝⣿⡿⣿⢿⢿⣛⢿⣿⣗⢇⠟⢦⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢾⣿⣿⣉⣉⣉⣸⣿⣿⣉⣉⢉⣿⠷⠶⠀⢸⣿⣿⢿⠀⠀⠀⠀⢸⠀⢀⡷⣿⣿⣿⢿⡿⡇⣿⣉⢾⣿⣿⠰⢶⡶⣿⣿⣿⣿⣹⣿⡀⠹⣿⣿⡹⣉⢷⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡭⣥⣿⣾⣿⣿⣿⣿⣿⣿⣓⡃⠐⠀⣘⣯⣿⣚⣟⢒⣓⣒⣿⣒⢺⣟⣻⡧⡉⣿⡿⠍⡭⢭⠨⠹⢿⣝⢒⡞⠀⡖⣚⢷⣙⢛⣯⣦⠈⠻⢿⣿⣮⣧⡀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⢩⣿⣿⣿⣾⣷⣿⣿⣿⣟⠒⠀⠐⠀⠉⡿⡟⠉⠹⣿⣟⣳⣶⣆⣴⠑⠀⢳⡄⠈⣷⡁⠁⠈⠀⢈⠙⣷⠀⣀⣀⣀⠀⢨⣷⠀⠊⣟⢣⠀⠀⠉⠛⠿⣿⣄⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣗⡺⣿⣿⣿⣿⣿⣿⣿⡿⡏⠍⠁⢈⠀⠉⠁⣷⠩⠩⠨⢿⣷⣿⣿⡟⠀⠈⠅⠽⣹⣯⡵⣖⣶⣶⣶⡖⣿⡬⢭⡭⣽⣿⠭⣿⡠⠥⣼⣷⢧⠀⠀⠀⠀⠀⠙⠳⢄⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣿⡏⡃⢀⣠⣬⣶⣶⣦⣍⢀⠈⢸⣘⣧⣿⣿⣏⠀⣀⠀⣃⣷⢿⣼⣽⣆⡲⡦⢵⣾⣿⠃⣧⣿⣿⡼⣿⣿⣇⣻⣿⣘⡆⠀⠀⠀⠀⠀⠀⠈⠛ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢦⣾⠟⠻⠹⢰⣶⣆⡚⢷⡀⠠⠶⡞⣾⣿⠤⠀⠠⡀⢒⡞⠻⣷⠐⢻⣿⣮⡕⣷⣿⡖⣿⣿⣿⡏⣽⣿⣿⢶⣿⣿⢾⡄⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣽⣿⣿⡯⡿⢿⢽⣽⣮⣯⣯⡟⠬⠅⢡⡀⣠⣽⣿⣧⠵⠁⠀⠀⠇⡍⢿⠀⠀⠤⠀⠏⠩⠬⠹⡤⠀⣿⢝⡿⡯⣾⣯⣿⣟⣯⣖⣺⣿⣕⠽⣯⣿⣬⣽⡀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣻⣿⣿⠷⠿⠿⣻⣿⣟⣿⣿⠆⠁⢠⣿⣿⡽⠿⡿⣿⠀⠀⠀⠀⠀⠉⠋⠀⠀⠀⠀⠒⠉⠊⢈⠋⠁⡋⣻⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣷⣿⣿⣟⣹⣿⡆⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⣿⣿⣿⣿⡭⢹⣿⣿⣻⣽⣿⡀⠀⢨⡇⠉⠍⢌⠼⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠴⣶⢶⠾⢦⣆⠂⠚⣿⣷⣽⡗⣿⡯⣿⠵⢿⣯⣯⣿⣿⣿⣕⣯⣇⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣯⣿⣗⣿⣿⣿⡓⣒⣛⣽⣿⣿⢿⣯⠥⠀⠈⢶⡂⠐⣾⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠉⢙⣿⣌⣮⠽⣿⣍⢯⣻⣻⣯⠭⠥⣯⠬⣿⣿⣿⣟⣿⣻⣾⣏⢹⡀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣾⣿⣷⣿⣿⡇⡇⠴⣹⣿⣿⣾⣉⢹⣄⡀⠀⠀⠉⠉⠀⠀⠀⠀⠀⠀⣠⡄⠀⠀⠀⠀⣀⣷⣶⣾⣿⣿⠈⠀⡉⣿⢙⣏⢾⣏⡉⡁⡁⣹⣿⣿⣳⣷⣿⣿⢞⣾⡌⡇⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣯⣿⣿⣿⣿⣭⠭⢭⣿⣿⣷⡒⢀⡶⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡿⠇⠀⠀⠀⠰⡟⣿⢨⠽⢕⡟⠀⠂⣲⡟⠒⢺⣽⣷⣾⡶⠒⣺⣿⣯⣿⣿⣾⢽⣝⣿⠆⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣟⣿⣿⣿⣧⣚⣾⣚⣿⣿⠬⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠋⠀⠀⠀⠀⠐⣇⠈⢐⢰⡏⠁⠠⢠⡿⠤⣤⣿⣻⣟⣿⠥⣾⣿⣿⣿⣿⣿⣿⡾⡳⣿⡇⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡷⣿⣿⣿⣿⡿⣽⣿⢿⣿⣿⠶⠾⣿⣿⢉⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠒⠛⠀⠤⠾⣛⣀⣽⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣿⡇⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣯⣿⣿⣿⣿⣫⣫⣿⣿⢕⣿⣭⢹⡿⣿⣷⣐⣀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⣢⣫⣿⣿⣟⣿⣿⣾⣻⣿⣿⣿⣿⣿⣿⣿⣿⣷⢿⡇⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⢟⢟⣿⣿⣷⡿⣟⢄⣻⡻⣿⣷⡬⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣾⣛⣿⣿⡿⣿⣿⣟⢟⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡄⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡿⣿⣿⣿⡗⣽⣿⣿⣿⣿⣕⡽⣍⢯⣿⣿⣿⢅⠠⠀⠀⠀⠀⠉⠙⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣬⣿⣿⣿⣿⣿⣿⣯⢿⣿⣿⡵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡽⣄⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⢸⣿⣿⠇⢸⣿⣿⣯⣺⣿⣿⣿⣿⣿⣿⣦⢟⣿⣯⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣾⣿⣿⣿⣿⣿⣿⣗⣟⣿⣿⣺⡯⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣺⡆⠀⠀⠀⠀ ⠀⠀⠀⠀⢀⣤⣶⣾⣷⣿⣿⣯⣳⡤⣀⣿⡏⠀⢸⣿⣿⣿⣾⠯⣿⣿⣿⣿⣿⣿⣿⢷⣿⣩⠨⠽⡿⣷⣄⠀⠀⠀⠀⠀⠀⠀⣀⣀⣠⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⢏⣀⣻⣿⣿⣿⣿⣿⣿⣿⣾⡿⣿⣯⢿⡀⠀⠀⠀ ⠀⢀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣟⣖⢤⣘⣿⣿⣿⣷⣽⣿⣿⣿⣿⣿⣿⣷⣗⣭⡿⣬⣭⡯⣭⣿⣿⣿⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣺⣿⣿⣿⣕⢒⣿⣿⣿⣿⣿⣿⣿⣿⣻⣾⡿⣿⣿⣇⠀⠀⠀ ⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣝⢻⡻⣿⣟⣿⢟⡿⣿⣾⣿⣷⣟⢶⠐⢐⣰⣇⣲⣗⣾⢐⣐⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢽⣟⢽⣿⡺⢩⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⡯⡾⣿⢽⡄⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣾⡻⣷⣿⣟⢿⣿⣿⣿⣿⢷⡤⠀⠴⠑⠷⠶⠰⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣻⢿⣿⣿⣿⣿⣿⣿⣿⣻⣿⣯⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⢟⢟⢿⣿⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣝⣿⣿⣝⣿⣿⣿⣿⣷⣽⣄⠄⠀⠄⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢝⣿⡆⠙⠿⣿⣿⣿⣿⣺⣺⠟⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⣟⢽⠈⢿⡆⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⢾⣿⣿⣿⣿⣿⣾⣇⡀⠆⢀⣿⣿⣷⣿⣿⣿⣿⢿⣿⠁⠈⣿⣿⣿⢾⡇⠀⠀⠀⠹⣿⡿⣿⣉⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏⣏⢾⠀⠀⣇⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⣿⣿⣿⣿⣿⣿⣮⡶⣤⣿⣿⣿⣿⣿⣿⣿⡿⣿⡗⠀⠀⠀⠙⢿⣿⣻⠀⠀⠀⠀⠈⣿⡿⣶⣾⣽⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⡏⠀⠀⣼⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢽⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣵⢝⢵⣿⡯⣯⠃⠀⠀⠀⠀⠀⠙⢿⡄⠀⠀⠀⢰⣿⠗⠉⠙⠿⣮⣧⡈⠻⣿⣿⣿⣿⣿⣿⣿⡯⣮⡇⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣫⣿⣿⣿⣿⣷⣿⣿⣿⣾⣾⣻⣻⣿⣻⣟⢿⣶⣄⡀⠀⠀⠀⠀⠀⠓⠀⠀⢠⡿⠁⠀⠀⠀⠀⠈⠙⠻⢦⠈⠿⣿⣿⣿⣿⣿⣟⣿⠁⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣾⣾⣿⣿⣿⣿⣾⣿⣿⣷⣽⣾⡿⣷⣤⣀⠀⠀⠀⠀⠀⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⠀⠈⠻⣿⣿⣿⣷⡏⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⡿⣿⣷⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⣿⡟⠀⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣾⡿⣷⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⠃⠀⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢯⣿⣯⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣯⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠋⠀⠀⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣿⠋⠀ */ // skibidi rizz #pragma GCC optimize("-funsafe-loop-optimizations") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-fwhole-program") #pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC optimize("-fthread-jumps") #pragma GCC optimize("-falign-functions") #pragma GCC optimize("-falign-jumps") #pragma GCC optimize("-falign-loops") #pragma GCC optimize("-falign-labels") #pragma GCC optimize("-fcaller-saves") #pragma GCC optimize("-fcrossjumping") #pragma GCC optimize("-fcse-follow-jumps") #pragma GCC optimize("-fcse-skip-blocks") #pragma GCC optimize("-fdelete-null-pointer-checks") #pragma GCC optimize("-fdevirtualize") #pragma GCC optimize("-fexpensive-optimizations") #pragma GCC optimize("-fgcse") #pragma GCC optimize("-fgcse-lm") #pragma GCC optimize("-fhoist-adjacent-loads") #pragma GCC optimize("-finline-small-functions") #pragma GCC optimize("-findirect-inlining") #pragma GCC optimize("-fipa-sra") #pragma GCC optimize("-foptimize-sibling-calls") #pragma GCC optimize("-fpartial-inlining") #pragma GCC optimize("-fpeephole2") #pragma GCC optimize("-freorder-blocks") #pragma GCC optimize("-freorder-functions") #pragma GCC optimize("-frerun-cse-after-loop") #pragma GCC optimize("-fsched-interblock") #pragma GCC optimize("-fsched-spec") #pragma GCC optimize("-fschedule-insns") #pragma GCC optimize("-fschedule-insns2") #pragma GCC optimize("-fstrict-aliasing") #pragma GCC optimize("-fstrict-overflow") #pragma GCC optimize("-ftree-switch-conversion") #pragma GCC optimize("-ftree-tail-merge") #pragma GCC optimize("-ftree-pre") #pragma GCC optimize("-ftree-vrp") #pragma GCC target("avx") #include<bits/stdc++.h> #define IOS ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie() #define ll long long #define ull unsigned long long #define pb push_back // #define endl "\n" // #define int ll #define F first #define S second #define db double #define ld long double #define short unsigned short #define pii pair<int,int> using namespace std; const ll inf = 1e17,MOD=1e9+7,N=2e5+10,MN=1e9+7,lim=1e6; const long db Pie=acos(-1); //...and justice for all int binpow(int a,int p); void solve(){ int n,m; cin>>n>>m; vector<int>o(m+1),p(n+1); for(int i=1;i<=m;i++){ cin>>o[i]; } for(int i=1;i<=n;i++){ cin>>p[i]; } vector<int>ans(n+1,-1); vector<int>cur(n+1,0); int k; cin>>k; for(int j=1;j<=k;j++){ int l,r,a; cin>>l>>r>>a; if(l<=r){ for(int i=l;i<=r;i++){ if(ans[o[i]]==-1&&cur[o[i]]+a>=p[o[i]]){ ans[o[i]]=j; } cur[o[i]]+=a; } } else{ for(int i=l;i<=m;i++){ if(ans[o[i]]==-1&&cur[o[i]]+a>=p[o[i]]){ ans[o[i]]=j; } cur[o[i]]+=a; } for(int i=1;i<=r;i++){ if(ans[o[i]]==-1&&cur[o[i]]+a>=p[o[i]]){ ans[o[i]]=j; } cur[o[i]]+=a; } } } for(int i=1;i<=n;i++){ if(ans[i]==-1){ cout<<"NIE"<<endl; } else{ cout<<ans[i]<<endl; } } } main() { srand(time(NULL)); IOS; //freopen("c oins.in", "r", stdin); //freopen("coins.out", "w", stdout); int UwU=1; // cin>>UwU; for(int i=1;i<=UwU;i++) { // cout<<"Case "<<i<<": "; solve(); // cout<<endl; } cout<<fixed<<setprecision(10); cerr<<"Time:"<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n"; } // int binmul(int a,int b){} int binpow(int a,int p){if(p==0)return 1;if(p%2){return ((binpow(a,p-1)*a)%MOD);}int res=binpow(a,p/2)%MOD; return (res*res)%MOD;}

Compilation message (stderr)

met.cpp:48:51: warning: bad option '-funsafe-loop-optimizations' to pragma 'optimize' [-Wpragmas]
   48 | #pragma GCC optimize("-funsafe-loop-optimizations")
      |                                                   ^
met.cpp:50:39: warning: bad option '-fwhole-program' to pragma 'optimize' [-Wpragmas]
   50 | #pragma GCC optimize("-fwhole-program")
      |                                       ^
met.cpp:60:41: warning: bad option '-fcse-skip-blocks' to pragma 'optimize' [-Wpragmas]
   60 | #pragma GCC optimize("-fcse-skip-blocks")
      |                                         ^
met.cpp:81:41: warning: bad option '-fstrict-overflow' to pragma 'optimize' [-Wpragmas]
   81 | #pragma GCC optimize("-fstrict-overflow")
      |                                         ^
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   86 | #pragma GCC target("avx")
      |                         ^
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes]
met.cpp:86:25: warning: ba
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...