前言:
这是我第一次(肯定不是最后一次)参加 $CSP$。
祝我 $rp++$。
初赛
复赛
$\texttt{Day -5 2020/11/1}$
复习期中考试......
$\texttt{Day -4 2020/11/3}$
考点在曹杨二中文萃楼 $613$ 欢迎面基,离我家好远。
复习语文。。明天语文期中考试。\fad
$\texttt{Day -1 2020/11/6}$
期中考试考完了。
明天 $CSP-J2$ 怕怕怕怕怕怕。
$\texttt{Day 0 2020/11/7}$
一早就走了。
开考。
cyez密码出了点问题,监考老师直接把文件发给我们了。
让我没想到的是, $T1$ 就炸了。
考场上没想到直接从大到小循环 $24$ 次暴力就可以了。
于是打了 $60$ 部分分,还打了表。
考场代码:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
ll max(ll a,ll b) {
if (a>=b) return a;
else return b;
}
ll min(ll p,ll q) {
if (p<q) return p;
else return q;
}
bool f(ll x) {
bool flag=false;
for (int l=1; pow(2,l)<=n; l++) {
if (pow(2,l)==n) flag=true;
}
if (flag==true) return true;
else return false;
}
int main() {
freopen("power.in","r",stdin);
freopen("power.out","w",stdout);
scanf("%lld",&n);
if (n%2==1) {
printf("-1\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==2) {
printf("2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==4) {
printf("4\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==6) {
printf("4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==8) {
printf("8\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==10) {
printf("8 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==126) {
printf("64 32 16 8 4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==254) {
printf("128 64 32 16 8 4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==510) {
printf("256 128 64 32 16 8 4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==1022) {
printf("512 256 128 64 32 16 8 4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==2046) {
printf("1024 512 256 128 64 32 16 8 4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
if (n==4094) {
printf("2048 1024 512 256 128 64 32 16 8 4 2\n");
fclose(stdin);
fclose(stdout);
return 0;
}
for (int k=1; pow(2,k)<=n; k++) {
if (pow(2,k)==n) {
printf("%d\n",n);
fclose(stdin);
fclose(stdout);
return 0;
}
}
while(f(n)==false) {
for (int i=n; i>=1; i--) {
if (pow(2,i)<n) {
n -= pow(2,i);
printf("%d ",pow(2,i));
}
}
printf("%d\n",n);
}
fclose(stdin);
fclose(stdout);
return 0;
}
$T2$ $O(n^2logn)$ 的模拟 $+$ 快排过了大样例。
但考试的时候没有算清楚复杂度。否则会用更快的排序方式的。
考场代码:
#include <bits/stdc++.h>
using namespace std;
int n,w;
int a[100005];
int b[100005];
int ans;
int max(int p,int q) {
if (p>=q) return p;
else return q;
}
bool cmp(int x,int y) {
return x>y;
}
int main() {
freopen("live.in","r",stdin);
freopen("live.out","w",stdout);
memset(b,0,sizeof(b));
scanf("%d %d",&n,&w);
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
// sort(a+1,a+n+1);
// for (int i=1;i<=n;i++) printf("%d ",a[i]);
for (int p=1;p<=n;p++) {
ans = max(1,p*w/100);
// printf("%d ",ans);
b[p] = a[p];
sort(b+1,b+n+1,cmp);
printf("%d ",b[ans]);
}
fclose(stdin);
fclose(stdout);
return 0;
}
$T3$ 看到题就蒙了。全输出 $0$ 骗分。
然而出了考场发现 cin>>s
不能输入包含空格的字符串。只有
getline(cin,s)
才可以。
爆 $0$。
$T4$ $dfs$暴力骗分。
正解应该是 $dp$,没想到。
期望: $70+60+0+10=140$。
估分: $60+40+0+10=110$。
凉了。
出考场。
然而,一到家我就会做了 $T1$,打出了 $AC$ 代码。
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
int main() {
freopen("power.in","r",stdin);
freopen("power.out","w",stdout);
scanf("%lld",&n);
if (n%2==1) {
printf("-1\n");
fclose(stdin);
fclose(stdout);
return 0;
}
for (int i=24;i>=1;i--) {
if (pow(2,i)<=n) {
cout<<(ll)pow(2,i)<<" ";
n -= pow(2,i);
}
if (n==0) break;
}
fclose(stdin);
fclose(stdout);
return 0;
}
想打人
晚上民间数据出来了。
计蒜客:70+50+0+5=125
oitiku:65+50+0+0=115
$\texttt{Day 1 2020/11/8}$
下午betway必威体育官方所有数据都出来了。
$60+50+0+5=115$
估计奖项: $2=$。
总结:
考场上可以再冷静一点,把复杂度算清楚,再耐心一点, $T1$ 和 $T2$都是可以 $AC$ 的。
$\texttt{Day 9 2020/11/16}$
中午 $B302$ 查分。
官网卡了好久才进去(貌似我是唯一一个进去的)
官方成绩:65+50+0+0=115
事实证明,betway必威体育官方是最靠谱的 $OJ$。
$\texttt{Day END 2020/11/21}$
在咕了一天多以后,在上晚课的时候公布了分数线。
官网果然炸了。
结果: $2=$。
我太菜了。
本篇游记更新结束 ~