ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 2002. Test Task

JAVA, plz help
Posted by fletcher6847 11 Nov 2016 12:58

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Timus2002 {

public static void main(String[] args) {

Map<String, String> map = new HashMap<>();
Scanner sc = new Scanner(System.in);
String[] s = new String[105];
ArrayList<String> logged = new ArrayList<>();
int n = Integer.parseInt(sc.nextLine());
for (int i = 0; i < n; i++) {
s[i] = sc.nextLine();
}

for (int i = 0; i < n; i++) {
String[] mas = s[i].split(" ");
if(mas[0].equals("register")){
if(map.containsKey(mas[1])){
continue;
}
map.put(mas[1], mas[2]);
}

String pass = mas[2];
System.out.println("fail: no such user");
continue;
}
if(!value.equals(pass))

if(value.equals(pass)) {
System.out.println("success: user logged in");
}
else

}
}

if(mas[0].equals("logout")) {
System.out.println("fail: no such user");