Sort by

recency

|

792 Discussions

|

  • + 0 comments
    date_returned, month_return, year_return=input().split(" ")
    date_due, month_due, year_due=input().split(" ")
    
    date_returned, month_return, year_return = int(date_returned), int(month_return), int(year_return)
    date_due, month_due, year_due = int(date_due), int(month_due), int(year_due)
    
    if date_returned<= date_due and month_return<=month_due and year_return<=year_due:
        print(int(0))
    if date_returned> date_due and month_return>month_due and year_return<year_due:
        print(int(0))
    if date_returned> date_due and month_return<=month_due and year_return<=year_due:
        fine=int(15*(date_returned-date_due))
        print(fine)
    if month_return>month_due and year_return==year_due:
        fine = int((month_return-month_due)*500)
        print(fine)
    if year_return>year_due:
        print(int(10000))
    
  • + 0 comments
    private static int crazyFee(int d, int m, int y, int dd, int dm, int dy) {
        return  ((y << 9) | (m << 5) | d) <= ((dy << 9) | (dm << 5) | dd) ? 0
                : (y ^ dy) == 0 && (m ^ dm) == 0 ? 15 * (d - dd)
                : (y ^ dy) == 0 ? 500 * (m - dm)
                : 10000;
    }
    
        and of course "python" style =) 
    
  • + 0 comments
    private static int getFine(int day, int month, int year, int dueDay, int dueMonth, int dueYear) {
        int returned = year * 10000 + month * 100 + day;
        int due = dueYear * 10000 + dueMonth * 100 + dueDay;
        if (returned <= due) {
            return 0;
        } else if (year == dueYear && month == dueMonth) {
            return 15 * (day - dueDay);
        } else if (year == dueYear) {
            return 500 * (month - dueMonth);
        } else {
            return 10000;
        }
    }
    
    private static int funFee(int d, int m, int y, int dd, int dm, int dy) {
        return (y * 10000 + m * 100 + d) <= (dy * 10000 + dm * 100 + dd)
                ? 0
                : y == dy && m == dm
                    ? 15 * (d - dd)
                    : y == dy
                        ? 500 * (m - dm)
                        : 10000;
    }
    
  • + 0 comments

    python3 d1, m1, y1 =list(map(int, input().split())) d2, m2, y2 =list(map(int, input().split()))

    if y1 > y2: print(10000) elif y1 == y2 and m1 > m2: print((m1-m2)*500) elif m1 == m2 and d1 > d2: print((d1-d2)*15) else: print(0)

  • + 0 comments

    rd,rm,ry=map(int,input().split()) dd,dm,dy=map(int,input().split()) t=0 if ry>dy: t+=10000 elif ry==dy: if rm>dm: t+=((rm-dm)*500) elif rm==dm: if rd>dd: t+=((rd-dd)*15) print(t)