oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

washing Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

washing.html

Problem Description

Benson has S school uniforms to wear, but has to use them over N days. He doesn't like having to wear a school uniform that has not be washed since it was last used. Thus, he has made a plan on how he should manage his school uniforms.

On every day, he does one of 2 things to his uniforms:

1. He uses one. This is represented by a USE input. He will always use a school uniform that has been washed after the last use.

2. He washes all his school uniforms. This is represented by a WASH input. All used school uniforms will be washed and can be used again.

Help Benson check whether his plan is feasible or not.

Input

The first line of input will contain two integers S and N.

The next N lines will contain a single string on each line, either USE or WASH.

Output

Output either "CLEAN"(without quotes) if he never has to use an unwashed used shirt or "DIRTY"(without quotes) if he has to eventually use an unwashed used shirt.

Limits

Subtask 1 (100%): 1 ≤ S, N ≤ 100

Subtask 2 (0%): Sample Testcases

Sample Testcase 1

Input

3 5
USE
USE
WASH
USE
WASH

Output

CLEAN

Sample Output 1 Explanation

Number the 3 uniforms 1, 2 and 3. Benson can use uniform 1 on the first day and uniform 2 on the second day. On the third day uniforms 1 and 2 are washed. On the fourth day he can use any uniform as they are all clean. Hence he does not ever need to use an unwashed used shirt.

Sample Testcase 2

Input

1 5
USE
USE
WASH
USE
WASH

Output

DIRTY

Sample Output 2 Explanation

Benson has only 1 uniform. After using his only uniform on the first day, he has no choice but to use the same (unwashed and used) uniform on the second day.

Tags

Syntax, Ad Hoc

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100191s32MBMinimum
2021s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o washing -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.