FPC20-034.Integrity Overflow
Easy · 1 s · 256 MB
- icpc
- fpc
- 2020
The Fortune Protection Corporation (FPC) is a company specialized in securely storing the money of their clients. The money safe is sealed with a 50 cm thick steel door that can only open after correctly entering the secret password in a terminal next to the door. The FPC takes the integrity of this system very serious, and wants to be sure that the door never opens when somebody enters an incorrect password. Since some of the employees of the FPC have dyslexia, the safe will also open when the password contains one incorrect character (it must have the correct length, though).
Given an audit log containing all access attempts to the safe, can you tell whether the integrity of the safe is compromised?
Giriş formatı
• One line with one integer: , the number of lines in the audit log.
• One line containing the correct password.
• lines with two words each, separated with a single space:
• The first word is the entered password.
• The second word is either “ALLOWED” or “DENIED”, depending on whether the password was correct or incorrect, respectively.
All passwords are at most 32 characters in length and only contain letters from the English alphabet (A-Z and a-z) and numbers (0-9).
Çıxış formatı
One line, containing “SYSTEM SECURE” if the audit log contains no suspicious access attempts, or “INTEGRITY OVERFLOW” if the security of the system has been compromised.
Qeyd
Source: Freshmen Programming Contest 2020 · License: CC BY-SA 4.0 · Original: https://fpc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.
Nümunələr
Giriş #1
4 SuperSecret123 SuperSecret123 ALLOWED SuperSekret123 ALLOWED Hunter02 DENIED password123 DENIED
Çıxış #1
SYSTEM SECURE
Giriş #2
4 CorrectHorseBatteryStaple CorrectHorseBatteryStaple ALLOWED HorseCorrectStapleBattery ALLOWED CorrectHorseBatteryStaple ALLOWED 123456789 DENIED
Çıxış #2
INTEGRITY OVERFLOW