QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#120064#5255. Greedy Drawershos_lyricAC ✓1ms3728kbC++142.1kb2023-07-06 13:04:392023-07-06 13:04:42

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-06 13:04:42]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3728kb
  • [2023-07-06 13:04:39]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }


constexpr int K = 7;
constexpr char DATA[K][K + 1] = {
"###....",
"###....",
"###....",
"..##...",
"...####",
"...####",
"...####",
};

int main() {
  int N;
  for (; ~scanf("%d", &N); ) {
    vector<int> A(N), B(N);
    for (int u = 0; u < N; ++u) {
      A[u] = 1 + u;
      B[u] = 1000 - u;
    }
    vector<int> X(N, 0), Y(N, 0);
    for (int u = 0; u < N; ++u) for (int v = 0; v < N; ++v) {
      if (u / K == v / K && DATA[u % K][v % K] == '#') {
        chmax(X[v], A[u]);
        chmax(Y[v], B[u]);
      }
    }
    
    for (int u = 0; u < N; ++u) {
      printf("%d %d\n", A[u], B[u]);
    }
    puts("");
    for (int v = 0; v < N; ++v) {
      printf("%d %d\n", X[v], Y[v]);
    }
#ifdef LOCAL
for(int u=0;u<N;++u){
 for(int v=0;v<N;++v)putchar(((A[u]<=X[v]&&B[u]<=Y[v])||(A[u]<=Y[v]&&B[u]<=X[v]))?'#':'.');
 puts("");
}
#endif
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3632kb

input:

150

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #2:

score: 0
Accepted
time: 1ms
memory: 3688kb

input:

151

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #3:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

152

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #4:

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

input:

153

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #5:

score: 0
Accepted
time: 1ms
memory: 3572kb

input:

154

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #6:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

155

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #7:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

156

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #8:

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

input:

157

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #9:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

158

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #10:

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

input:

159

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #11:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

160

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #12:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

161

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #13:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

162

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #14:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

163

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #15:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

164

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #16:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

165

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #17:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

166

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #18:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

167

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #19:

score: 0
Accepted
time: 1ms
memory: 3688kb

input:

168

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy

Test #20:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

250

output:

1 1000
2 999
3 998
4 997
5 996
6 995
7 994
8 993
9 992
10 991
11 990
12 989
13 988
14 987
15 986
16 985
17 984
18 983
19 982
20 981
21 980
22 979
23 978
24 977
25 976
26 975
27 974
28 973
29 972
30 971
31 970
32 969
33 968
34 967
35 966
36 965
37 964
38 963
39 962
40 961
41 960
42 959
43 958
44 957
...

result:

ok you killed Janko's strategy