QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#448473#8631. 疯狂THUonly3100 ✓0ms3716kbC++14902b2024-06-19 17:26:392024-06-19 17:26:39

Judging History

你现在查看的是最新测评结果

  • [2024-06-19 17:26:39]
  • 评测
  • 测评结果:100
  • 用时:0ms
  • 内存:3716kb
  • [2024-06-19 17:26:39]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    int y, m, d;
    cin >> y >> m >> d;

    if (m <= 2)
    {
        m += 12;
        y--;
    }

    int c = y / 100;
    int cnt = (m + 1) * 26 / 10;
    int y1 = y % 100;

    int ans = y1 + y1 / 4 + c / 4 - 2 * c + cnt + d - 1;

    if (ans >= 0)
    {
        if (ans % 7 == 4)
        {
            cout << "Crazy THU!" << endl;
        }
        else
        {
            cout << "Not crazy enough." << endl;
        }
    }
    else
    {
        while (ans < 0)
        {
            ans += 21;
        }

        if (ans % 7 == 4)
        {
            cout << "Crazy THU!" << endl;
        }
        else
        {
            cout << "Not crazy enough." << endl;
        }
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 10
Accepted
time: 0ms
memory: 3636kb

input:

2024 2 29

output:

Crazy THU!

result:

ok single line: 'Crazy THU!'

Test #2:

score: 10
Accepted
time: 0ms
memory: 3632kb

input:

2024 2 11

output:

Not crazy enough.

result:

ok single line: 'Not crazy enough.'

Test #3:

score: 10
Accepted
time: 0ms
memory: 3576kb

input:

2024 2 8

output:

Crazy THU!

result:

ok single line: 'Crazy THU!'

Test #4:

score: 10
Accepted
time: 0ms
memory: 3580kb

input:

2024 9 12

output:

Crazy THU!

result:

ok single line: 'Crazy THU!'

Test #5:

score: 10
Accepted
time: 0ms
memory: 3580kb

input:

2024 11 11

output:

Not crazy enough.

result:

ok single line: 'Not crazy enough.'

Test #6:

score: 10
Accepted
time: 0ms
memory: 3716kb

input:

2003 10 9

output:

Crazy THU!

result:

ok single line: 'Crazy THU!'

Test #7:

score: 10
Accepted
time: 0ms
memory: 3580kb

input:

2097 1 26

output:

Not crazy enough.

result:

ok single line: 'Not crazy enough.'

Test #8:

score: 10
Accepted
time: 0ms
memory: 3632kb

input:

9700 3 3

output:

Not crazy enough.

result:

ok single line: 'Not crazy enough.'

Test #9:

score: 10
Accepted
time: 0ms
memory: 3668kb

input:

5897 2 5

output:

Not crazy enough.

result:

ok single line: 'Not crazy enough.'

Test #10:

score: 10
Accepted
time: 0ms
memory: 3580kb

input:

3906 12 6

output:

Crazy THU!

result:

ok single line: 'Crazy THU!'