QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#137126#5255. Greedy DrawersForever_Young#AC ✓1ms3836kbC++144.3kb2023-08-09 22:06:392023-08-09 22:06:43

Judging History

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

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

answer

#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<chrono>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<iomanip>
#include<random>
#include<ctime>
#include<complex>
#include<type_traits>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long LL;
typedef double D;
#define all(v) (v).begin(), (v).end()
mt19937 gene(chrono::system_clock::now().time_since_epoch().count());
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
    const int maxn = 131072;
    static char buf[maxn],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
    int res(0);
    char c = getchar();
    while(c < '0') c = getchar();
    while(c >= '0') {
        res = res * 10 + (c - '0');
        c = getchar();
    }
    return res;
}
inline LL fastpo(LL x, LL n, LL mod) {
    LL res(1);
    while(n) {
        if(n & 1) {
            res = res * (LL)x % mod;
        }
        x = x * (LL) x % mod;
        n /= 2;
    }
    return res;
}
template<LL mod> struct Num {
	LL a;
	Num operator + (const Num & b) { return Num{(a + b.a) % mod}; }
	Num operator - (const Num & b) { return Num{(a - b.a + mod) % mod}; }
	Num operator * (const Num & b) { return Num{a * b.a % mod}; }
	Num operator / (const Num & b) { return Num{a * fastpo(b.a, mod - 2, mod) % mod}; }
	void operator += (const Num & b) {if((a += b.a) >= mod) a -= mod;}
	void operator -= (const Num & b) {if((a -= b.a) < 0) a += mod;}
	void operator *= (const Num & b) { a = a * b.a % mod; }
	void operator /= (const Num & b) { a = a * fastpo(b.a, mod - 2, mod) % mod; }
	void operator = (const Num & b) { a = b.a; }
	void operator = (const LL & b) { a = b; }
};
template<LL mod> ostream & operator << (ostream & os, const Num<mod> & a) {
	os << a.a;
	return os;
}
LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }

inline string itoa(LL x, int width = 0) {
	string res;
	if(x == 0) res.push_back('0');
	while(x) {
		res.push_back('0' + x % 10);
		x /= 10;
	}
	while((int)res.size() < width) res.push_back('0');
	reverse(res.begin(), res.end());
	return res;
}
const int _B = 131072;
char buf[_B];
int _bl = 0;
inline void flush() {
	fwrite(buf, 1, _bl, stdout);
	_bl = 0;
}
__inline void _putchar(char c) {
	if(_bl == _B) flush();
	buf[_bl++] = c;
}
inline void print(LL x, char c) {
	static char tmp[20];
	int l = 0;
	if(!x) tmp[l++] = '0';
	else {
		while(x) {
			tmp[l++] = x % 10 + '0';
			x /= 10;
		}
	}
	for(int i = l - 1; i >= 0; i--) _putchar(tmp[i]);
	_putchar(c);
}
typedef double C;
struct P {
	C x, y;
	void scan() {
		double _x, _y;
		scanf("%lf%lf", &_x, &_y);
		x = _x; y = _y;
	}
	void print() {
		cout << '(' << x << ' ' << y << ')' << endl;
	}
	P operator + (const P & b) const { return P{x + b.x, y + b.y}; }
	P operator - (const P & b) const { return P{x - b.x, y - b.y}; }
	C operator * (const P & b) const { return x * b.y - y * b.x; }
	C operator % (const P & b) const { return x * b.x + y * b.y; }
};
P operator * (const C & x, const P & b) { return P{x * b.x, x * b.y}; }
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
char st[2][22];
int pt[6][2] = {
{0, 8},
{6, 6},
{6, 4},
{7, 4},
{0, 4},
{3, 4}};
int qt[6][2] = {
{1, 8},
{8, 6},
{9, 7},
{7, 8},
{1, 8},
{3, 5}};
int main() {
	int n;
	scanf("%d", &n);
	int L = 1;
	vector<pair<int, int> > ps, qs;
	for(int i = 0; i < 50; i++) {
        for(int j = 0; j < 6; j++) {
            ps.pb({L + pt[j][0], 1001 - L - 9 + pt[j][1]});
            qs.pb({L + qt[j][0], 1001 - L - 9 + qt[j][1]});
        }
        L += 10;
	}
	ps.resize(n);
	qs.resize(n);
	for(int i = 0; i < n; i++) {
		printf("%d %d\n", ps[i].fi, ps[i].se);
	}
    printf("\n");
	for(int i = 0; i < n; i++) {
		printf("%d %d\n", qs[i].fi, qs[i].se);
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

150

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #2:

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

input:

151

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #3:

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

input:

152

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #4:

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

input:

153

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #5:

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

input:

154

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #6:

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

input:

155

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #7:

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

input:

156

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #8:

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

input:

157

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #9:

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

input:

158

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #10:

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

input:

159

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #11:

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

input:

160

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #12:

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

input:

161

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #13:

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

input:

162

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #14:

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

input:

163

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #15:

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

input:

164

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #16:

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

input:

165

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #17:

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

input:

166

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #18:

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

input:

167

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #19:

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

input:

168

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy

Test #20:

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

input:

250

output:

1 999
7 997
7 995
8 995
1 995
4 995
11 989
17 987
17 985
18 985
11 985
14 985
21 979
27 977
27 975
28 975
21 975
24 975
31 969
37 967
37 965
38 965
31 965
34 965
41 959
47 957
47 955
48 955
41 955
44 955
51 949
57 947
57 945
58 945
51 945
54 945
61 939
67 937
67 935
68 935
61 935
64 935
71 929
77 92...

result:

ok you killed Janko's strategy