QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#658069#7111. Press the Button11131241WA 74ms3604kbC++171.6kb2024-10-19 16:05:452024-10-19 16:05:46

Judging History

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

  • [2024-10-19 16:05:46]
  • 评测
  • 测评结果:WA
  • 用时:74ms
  • 内存:3604kb
  • [2024-10-19 16:05:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef unsigned long long ull;
using ld = long double;
#define PII pair<int, int>
#define inf 0x3f3f3f3f
#define INF 0x7fffffff
#define lowbit(x) ((x) & (-x))
double PI = acos(-1.0);
#define eps 1e-7
const int d[4][2] = { {1, 0}, {-1, 0}, {0, 1}, {0, -1} };
const int maxn = 2e8 + 5;
const int mod = 998244353;
const int N = 1011;
int fast_Pow(int a, int n, int mod)
{
    int ans = 1 % mod;
    a %= mod;
    while (n)
    {
        if (n & 1)
            ans = (ans * a) % mod;
        a = (a * a) % mod;
        n >>= 1;
    }
    return ans;
}


void solve()
{
    int a, b, c, d,v;
    int t;
    int cnt = 0;
    int now =0;
    int time = 0;
    
    cin >> a >> b >> c >> d >>v>> t;
    t *= 2;
    time = v * 2 + 1;
    while (now <= t)
    {
        
        for (int i =time; i > 0; i--)
        {
            if (now == t)
            {
                if ((i / 2) % a == 0 and i % 2 == 0)
                    cnt ++;
                else  if ((i / 2) % b == 0 and i % 2 == 0)
                    cnt ++;
                now++;
                break;
            }

            if ((i / 2) % a == 0 and i%2==0)
                cnt += b;
            if ((i / 2) % b == 0 and i % 2 == 0)
                cnt += d;
            now++;

        }
        now++;
    }
    
    cout << cnt<<endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int tcase = 1;
    cin >> tcase;
    while (tcase--)
        solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

2
8 2 5 1 2 18
10 2 5 1 2 10

output:

6
4

result:

ok 2 number(s): "6 4"

Test #2:

score: -100
Wrong Answer
time: 74ms
memory: 3604kb

input:

1000
8 6 2 6 3 17
1 6 1 1 1 30
5 4 8 8 1 31
7 6 10 3 6 12
9 1 4 4 3 38
3 3 5 8 1 8
9 1 5 2 3 18
6 10 10 8 2 40
9 6 9 10 3 9
2 5 1 10 10 39
7 7 1 2 4 19
8 10 8 6 7 36
2 9 1 1 7 17
1 2 3 5 6 14
8 8 8 7 1 46
6 9 3 9 4 6
10 8 1 7 10 18
7 1 7 10 3 50
1 10 2 1 5 1
5 8 4 9 7 44
9 2 5 4 7 42
9 1 2 1 1 20
5 ...

output:

0
90
0
6
116
0
28
0
0
170
0
0
54
54
0
0
30
380
10
48
64
10
98
60
0
15
0
80
40
90
28
50
33
0
93
100
30
0
32
20
0
137
0
0
28
9
10
70
0
9
0
52
171
10
0
7
30
20
320
216
35
0
42
0
45
321
0
180
0
140
0
91
0
28
29
100
168
304
36
47
32
130
0
50
22
10
45
82
45
0
36
0
310
90
65
62
10
118
40
0
0
0
0
0
0
0
378
...

result:

wrong answer 1st numbers differ - expected: '71', found: '0'