QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#137120 | #5255. Greedy Drawers | Forever_Young# | WA | 1ms | 3768kb | C++14 | 4.2kb | 2023-08-09 21:31:29 | 2023-08-09 21:31:32 |
Judging History
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 main() {
int n;
scanf("%d", &n);
int L = 1;
vector<pair<int, int> > ps, qs;
for(int i = 0; i < 100; i++) {
ps.pb({L, 1001 - L});
ps.pb({L + 1, 1001 - L - 1});
ps.pb({L + 2, 1001 - L - 2});
qs.pb({L, 1000 - L});
qs.pb({L + 1, 1000 - L - 1});
qs.pb({L + 1, 1000 - L - 1});
L += 3;
}
ps.resize(n);
qs.resize(n);
for(int i = 0; i < n; i++) {
printf("%d %d\n", qs[i].fi, qs[i].se);
}
for(int i = 0; i < n; i++) {
printf("%d %d\n", ps[i].fi, ps[i].se);
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
input:
150
output:
1 999 2 998 2 998 4 996 5 995 5 995 7 993 8 992 8 992 10 990 11 989 11 989 13 987 14 986 14 986 16 984 17 983 17 983 19 981 20 980 20 980 22 978 23 977 23 977 25 975 26 974 26 974 28 972 29 971 29 971 31 969 32 968 32 968 34 966 35 965 35 965 37 963 38 962 38 962 40 960 41 959 41 959 43 957 44 956 4...
result:
wrong answer Janko passed your test!