2018-08-30 拼多多笔试

T1:

public class TT1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int HP = sc.nextInt();
        int normalAttack = sc.nextInt();
        int buffedAttack = sc.nextInt();
        if(normalAttack * 2 >= buffedAttack) {
            int res = HP/normalAttack;
            if(HP%normalAttack!=0)
                res += 1;
            System.out.println(res);
        }else {
            int res = HP/buffedAttack*2;
            if(HP%buffedAttack!=0) {
                if(HP%buffedAttack

T2:

public class TT2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        char[][] str = new char[n][m];
        sc.nextLine();
        for (int i = 0;i < n;i ++){
            String input=sc.nextLine();
            str[i] = input.toCharArray();
        }
        for(int i=0;i=0;j--){
                if(str[j][i]!='o')continue;
                int k = j;
                while(k

T3:

public class TT3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        Map map = new HashMap<>();
        a %= b;
        if(a==0){
            System.out.println(0+" "+0);
        }else{
            int x = 1;
            while(!map.containsKey(a) && a != 0){
                map.put(a, x++);
                a = a*10;
                a %= b;
            }
            if(a==0){
                System.out.println(x-2+" "+0);
            } else{
                System.out.println(map.get(a)-1+" "+(x-map.get(a)));
            }
        }       
    }
}

T4:

public class TT5 {
    static int flag = 0;
    static Map map = new HashMap<>();
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();
        sc.nextLine();
        char[] ans = new char[l];
        int[][] vis = new int[l][26];
        for(int i=0;i

你可能感兴趣的:(2018-08-30 拼多多笔试)