#include <iostream>
int main()
{
using namespace std;
const string password = "123456";
string attempted;
cout << "Enter correct password" << endl;
for (int i = 0; i < 3; i++)
{
cin >> attempted;
if (attempted == password)
{
cout << "Successful login" << endl;
return 0;
}
else
{
cout << "Wrong password" << endl;
}
}
cout << "Access denied" << endl;
return 0;
}
def run():
a = int(input())
b = int(input())
trains = []
for i in range(a + b):
trains.append(int(input()))
t = 0
s = sum(i if i >= 0 else -i for i in trains)
while True:
for i in range(a):
trains[i] += 1
for i in range(b):
trains[a + i] -= 1
s1 = sum(i if i >= 0 else -i for i in trains)
if s1 < s:
s = s1
t += 1
else:
return t
print(run())
Объяснение:
Язык Python, на
ответ: 2.