YN CSP-S 2025 迷惑行为大赏
本文由 fkxr(YN-S00085)与 Z3k7223(YN-S00165)共同收集。
概述
YN CSP-S 2025 的准考证号的最大值为 YN-S00476,然而只有
万能头共被使用
累计搜索到了 // *freopen。祝他们好运。
累计搜索到了 "w" *, *stdin 以及 "r" *, *stdout。祝他们好运。
禁 5 系列
YN-SXXXX7
club
void fkccf() {
int n;
YN-SXXXX4
club
/*以上省略
memset(sum2, 0, sizeof(sum2));
ans = 0;
}
return 0;
}
*/
//fuck CCF
//CCF毁了我的信竞梦
//CCF have no mother
//#include <windows.h>
#include <bits/stdc++.h>
using namespace std;
int n, a[114514], b, c;
long long ans;
int main() {
freopen("club.in", "r", stdin);
freopen("club.out", "w", stdout);
//freopen("club.in", "r", stdin);
//freopen("club.out", "w", stdout);Never gonna give you up
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i] >> b >> c;
sort(a + 1, a + n + 1);
for (int i = n; i >= n / 2 + 1; i--)
ans += a[i];
cout << ans << endl;
return 0;
}
CCF 相关
YN-S00445
不明所以,经测试,该代码取得了
// I LOVE CCF!!!!!!!!!
#include <bits/stdc++.h>
using namespace std;
int n, m, k, ex[15][1010], cost[15];
bool vis[15];
....
YN-S00438
该选手在 club 和 road 两题中均定义了
const int ccf = ...
教练我明明写了系列
YN-S00288 -> club.cpp
#include <bits\stdc++.h>
using namespace std;
最多 define 奖
YN-S00085
该选手以 road 一题代码 define 拿下该奖项,同时还有巨长缺省源,下面放出他的代码:
::::info[code]
//by haotian,sun
//面积luogu联系 @fkxr(uid=995934)
#include<bits/stdc++.h>
#define endl cerr<<"I love Olympiad in Informatics!\n"
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
#ifdef __linux__
#define gc getchar_unlocked
#define pc putchar_unlocked
#else
#define gc getchar
#define pc putchar
#endif
namespace FastIO{
void r(int &a){
a=0;bool ok=0;char ch=gc();
for(;ch>'9'||ch<'0';ch=gc())ok^=(ch=='-');
for(;ch>='0'&&ch<='9';ch=gc())
a=(a<<3)+(a<<1)+ch-'0';
if(ok)a=-a;
}
void w(int a){
if(a==0){pc('0');return;}
int till=0;char ch[25];
if(a<0){
pc('-');
for(;a;a/=10)ch[till++]=-(a%10);
}else for(;a;a/=10)ch[till++]=a%10;
for(;till;)pc(ch[--till]+'0');
}
struct FIstream{
FIstream operator>>(int &x){r(x);return {};}
}in;
struct FOstream{
FOstream operator<<(int x){w(x);return {};}
FOstream operator<<(char ch){pc(ch);return {};}
FOstream operator<<(string s){for(auto ch:s)pc(ch);return {};}
}out;
}using FastIO::in;using FastIO::out;
namespace code{
void Freopen(string s){
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str(),"w",stdout);
}
struct node{
int u,v,w;
friend bool operator<(node a,node b){
return a.w<b.w;
}
};
int fa[10050];
int find(int x){
return fa[x]==x?x:fa[x]=fa[fa[x]]=fa[fa[fa[x]]]=find(fa[fa[fa[x]]]);
}
#define reset for(int i=1;i<=n+15;i++)fa[i]=i
vector<node>g,e;int n,m,k;
int ans=0;
vector<node>a[15];
int c[15];
void dfs(int x,int cnt,vector<node>e,int ansnw){
if(x==k){
reset;
for(auto i:e){
if(find(i.u)!=find(i.v)){
ansnw+=i.w,--cnt;
fa[fa[i.u]]=i.v;
}
if(!cnt)break;
}
ans=min(ans,ansnw);
return;
}
dfs(x+1,cnt,e,ansnw);
vector<node>tmp;
int lst=0;
for(auto i:a[x]){
for(;lst<e.size()&&e[lst]<i;++lst)
tmp.push_back(e[lst]);
tmp.push_back(i);
}
for(;lst<e.size();++lst)tmp.push_back(e[lst]);
dfs(x+1,cnt+1,tmp,ansnw+c[x]);
}
void Main(){
Freopen("road");
//auto timea=clock();
in>>n>>m>>k;
for(int i=1;i<=m;i++){
int x,y,z;in>>x>>y>>z;
g.push_back({x,y,z});
}
sort(all(g));reset;
int cnt=0;
for(auto i:g){
if(find(i.u)!=find(i.v)){
ans+=i.w,++cnt,
fa[fa[i.u]]=i.v,
e.push_back(i);
if(cnt==n-1)break;
}
}
//kelusikaer
/*priority_queue<pair<int,pair<int,int>>>q;
q.push({0,{1,-1}});memset(dis,0x3f,sizeof(dis));
dis[1]=0;
for(;!q.empty();){
auto t=q.top();q.pop();
int x=t.second.first,frm=t.second.second;
if(dis[x]!=-t.first)continue;
if(frm!=-1)e.push_back(g[frm]);
for(auto i:es[x]){
assert(i<m);
int v=(g[i].u^g[i].v^x),w=g[i].w;
if(dis[v]>dis[x]+w){
dis[v]=dis[x]+w;
q.push({-dis[v],{v,i}});
}
}
}*/
/*for(int i=1;i<=n;i++)out<<find(i)<<" ";
endl;*/
//out<<ans<<"\n";endl;
for(int i=0;i<k;i++){
in>>c[i];
for(int j=1;j<=n;j++){
int x;in>>x;
a[i].push_back({j,n+i+1,x});
}
sort(all(a[i]));
}
//cerr<<clock()-timea<<"\n";
dfs(0,n-1,e,0);
out<<ans<<"\n";
//cerr<<clock()-timea<<"\n";
}
}
signed main(){
code::Main();
return 0;
}
::::
最长代码奖
恭喜 YN-S00096\club\club.cpp 以
然而根据官方数据,这位选手本题获得了
::::info[code]
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct Stu
{
int one,two,three;
};
bool cmp1(Stu a,Stu b)
{
return a.one > b.one;
}
bool cmp2(Stu a,Stu b)
{
return a.two > b.two;
}
bool cmp3(Stu a,Stu b)
{
return a.three > b.three;
}
int main()
{
freopen("club.in","r",stdin);
freopen("club.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int T,n;
vector<Stu> mat;
cin >> T;
Stu in_s;
int in_mx,ans = 0,mx1,mx2,mx3,x,y,len,hh = 0,g1,g2,g3;
bool A = 1,B = 1;
for(int i = 0;i < T;i++)
{
ans = hh = 0;
mx1=mx2=mx3=0;
mat.clear();
g1 = g2 = g3 = 0;
cin >> n;
for(int j = 0;j < n;j++)
{
cin >> in_s.one >> in_s.two >> in_s.three;
if(in_s.two != 0 || in_s.three != 0)
{
A = 0;
}
if(in_s.three != 0)
{
B = 0;
}
mx1 += in_s.one,mx2 += in_s.two,mx3 += in_s.three;
if(in_s.one >= in_s.two && in_s.two >= in_s.three)
{
g1++;
}
else if(in_s.two >= in_s.one && in_s.two >= in_s.three)
{
g2++;
}
else{
g3++;
}
hh += max(in_s.one,max(in_s.two,in_s.three));
mat.push_back(in_s);
}
if(A)
{
sort(mat.begin(),mat.end(),cmp1);
for(int i = 0;i < n / 2;i++)
{
ans += mat[i].one;
}
cout << ans << '\n';
continue;
}
if(g1 <= n/2 && g2 <= n/2 && g3 <= n/2)
{
cout << hh << '\n';
continue;
}
if(mx1 >= mx2 && mx2 >= mx3)
{
sort(mat.begin(),mat.end(),cmp1);
x =mat.size(),y = n/2;
len = min(x,y);
for(int j = 0;j < len;j++)
{
ans += mat[j].one;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp2);
for(int j = 0;j < len;j++)
{
ans += mat[j].two;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp3);
for(int j = 0;j < len;j++)
{
ans += mat[j].three;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
}
else if(mx2 >= mx1 && mx1 >= mx3)
{
sort(mat.begin(),mat.end(),cmp2);
x =mat.size(),y = n/2;
len = min(x,y);
for(int j = 0;j < len;j++)
{
ans += mat[j].two;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp1);
for(int j = 0;j < len;j++)
{
ans += mat[j].one;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp3);
for(int j = 0;j < len;j++)
{
ans += mat[j].three;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
}
else if(mx3 >= mx1 && mx1 >= mx2)
{
sort(mat.begin(),mat.end(),cmp3);
x =mat.size(),y = n/2;
len = min(x,y);
for(int j = 0;j < len;j++)
{
ans += mat[j].three;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp1);
for(int j = 0;j < len;j++)
{
ans += mat[j].one;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp2);
for(int j = 0;j < len;j++)
{
ans += mat[j].two;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
}
else if(mx1 >= mx3 && mx3 >= mx2)
{
sort(mat.begin(),mat.end(),cmp1);
x =mat.size(),y = n/2;
len = min(x,y);
for(int j = 0;j < len;j++)
{
ans += mat[j].one;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp3);
for(int j = 0;j < len;j++)
{
ans += mat[j].three;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp2);
for(int j = 0;j < len;j++)
{
ans += mat[j].two;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
}
else if(mx2 >= mx3 && mx3 >= mx1)
{
sort(mat.begin(),mat.end(),cmp2);
x =mat.size(),y = n/2;
len = min(x,y);
for(int j = 0;j < len;j++)
{
ans += mat[j].two;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp3);
for(int j = 0;j < len;j++)
{
ans += mat[j].three;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp1);
for(int j = 0;j < len;j++)
{
ans += mat[j].one;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
}
else if(mx3 >= mx1 && mx1 >= mx2)
{
sort(mat.begin(),mat.end(),cmp3);
x =mat.size(),y = n/2;
len = min(x,y);
for(int j = 0;j < len;j++)
{
ans += mat[j].three;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp1);
for(int j = 0;j < len;j++)
{
ans += mat[j].one;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
x =mat.size(),y = n/4;
sort(mat.begin(),mat.end(),cmp2);
for(int j = 0;j < len;j++)
{
ans += mat[j].two;
mat[j].one = 0;
mat[j].two = 0;
mat[j].three = 0;
}
}
else{
cout << hh << '\n';
continue;
}
cout << ans << '\n';
}
return 0;
}
::::
不删大样例
YN-S00316
_getchar_nolock
YN-S00040
该选手在 club 和 road 中写道
int qin()
{
int x = 0;
char c;
c = _getchar_nolock();
while (c < '0' || c > '9')
c = _getchar_nolock();
while (c >= '0' && c <= '9')
x = x * 10 + c - '0', c = _getchar_nolock();
return x;
}
其他题目均未作答。让我们祝 Ta 保龄快乐。
代码邮寄
YN-S00052
//14:43题太难了QAQ
//可能出现的笑话:
//t1暴力dfs 10分勇夺一等(*^_^)
//14:53 键盘好烂...
//16:10 我太弱了...现在才写完dfs
保佑
YN-S00193
club:
//14:57 finish 100
//fyc 保佑我这题不挂分!
road:
//16:20 finish ?~100
//有点卡线 5e7 常数大 自测卡满18.94s
//lsy 保佑我这题冲过去1s以内100pts
employ:
//18:08 finish 24 so excited
//P2441M 保佑我这题24分不挂
replace:
//摆烂了 15pts 保佑我别挂吧
注释题解
YN-S00231
/*
T1
似乎是个贪心或背包,一种显然的做法是
先将所有人全部分配至三个所有部门,再每次减去最小的满意度
尝试举反例
以上做法一眼假
考虑DP
一种不难想到的是
DP[I][J][K]表示,1,2,3部门有I,J,K个成员情况下最大值
数据范围N=1E5,则复杂度N*N*N,TLE
考虑观察特殊性质
对于性质A
直接贪心即可,选取前N/2最大的即可
对于性质B
AI3=0
则考虑带悔贪心
遍历过程中算出反悔的代价,当该物品的代价比反悔代价小时,选该物品
考虑J=3
------------------------------
疑似正解:带悔贪心
我们只需要在遍历过程中维护三个优先队列,
记录之前反悔代价的最小值,遍历一个新值时,若不能添加,则选出最小代价,进行反悔
预计CODE时间:40MIN
*/
/*
T2疑似最小生成树
考虑J=10
于是最多有1024种情况
每种情况跑一遍最小生成树,复杂度(2^10 * M *LOG M)
=2E10似乎卡常也能过?
考虑更好的做法?
一种72分做法:对于性质A,最小生成树,
其他情况,状压后最小生成树
疑似正解:
先将所有乡村和原本的道路花费分别排序
状压枚举状态后维护J个指针,模拟优先队列
时间复杂度O(M * log M + 2^10 * M *10 * log 10 )
-----------------------------
题目理解错了
对于不用考虑村庄的16分
直接最小生成树
考虑性质A
因为村庄A J I=0,直接相连后,还是最小生成树
于是拿到44分,再考虑怎么讲特殊情况变为性质A
疑似正解:
考虑将所有村庄的最小路加上最小花费视为启用村庄的花费
再将上面看错题目的思路带入
先将所有乡村和原本的道路花费分别排序
状压枚举状态后维护J个指针,模拟优先队列
时间复杂度O(M * log M + 2^10 * M *10 * log 10 )
CODE TIME :1H15MIN
流程:
先预处理,将道路排序,再枚举村庄选择状态,更具每个状态跑一遍最小生成树
*/
hyw
YN-S00234
//AFO
//rp++;
//和溢位!!!
不爱 Freopen
YN-S00476
#include < bits / stdc++.h >
using namespace std;
int main() {
//freopen("replc.in""r")
//freopen("replc.out""w")
int a = 1;
for (int i, i = 0, i <= 9) {
a + a + a = a;
a *a *a = a;
if (a > 1) {
a *a *a *a *a *a = a;
a *a *a *a *a *a *a *a *a *a *a *a = a;
}
}
int b = 1, c = 1, d = 1, e = 1, f = 1, g = 1, h = 1, i = 1, j = 1 =, k = 1
cout << a << endl;
ruturn 0;
}
似乎还忘记 return 怎么写了,而且这个代码是 hyw?
YN-S00007
//freopen("club.in", "r", stdin);
//freopen("club.out", "l", stdout);
YN-S00125
//freopen("club.in", "r", stdin);
//freopen("club.out", "l", stdout);
上述的错误太过低级,我们需要人数较少的。
正则表达式 freopen\("club[0-9] 的匹配结果(手动排除注释内的):
- YN-S00103
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
freopen("club1.in", "r", stdin);
freopen("club.out", "w", stdout);
- YN-S00408
int main() {
freopen("club2.in", "r", stdin);
freopen("club.out", "w", stdout);
- YN-S00433
int main() {
freopen("club1.in", "r", stdin);
freopen("club.out", "w", stdout);
正则表达式 freopen\("road[0-9] 的匹配结果(手动排除注释内的):
- YN-S00214
int main() {
freopen("road1.in", "r", stdin);
freopen("road.out", "w", stdout);
正则表达式 freopen\("replace[0-9] 的匹配结果(手动排除注释内的):
- YN-S00036
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
freopen("replace1.in", "r", stdin);
freopen("test1.out", "w", stdout);
正则表达式 freopen\("employ[0-9] 的匹配结果(手动排除注释内的):
- YN-S00055
int main() {
freopen("employ1.in", "r", stdin);
freopen("employ.txt", "w", stdout);
他也是唯一的 .txt 的搜索结果。
不明所以
YN-S00452
#include <bits/stdc++.h>
using namespace std;
int n;
long long niunnununununnunnvubibdviwbybvusjfbniuabfbhv_uy;
unsigned unoiwvouiwbbuinojnbvwenbbnlinwubnebinl_kuvfbuwb_uygvivhve_kgvc;
unsigned ibbwbyibvqiuvb_libvoubqeviqib_vbu;
int main() {
freopen ("replace.in", "r", stdin);
freopen ("replace.out", "w", stdout);
for (int i = 1; i <= n; ++i) {
cout << "0";
}
return 0;
}
代码加加长
YN-S00056 -> road.cpp
在文件结尾复制粘贴了
.cpp.cpp
让我们祝 YN-S00417 好运。
你对得起英语老师对你的教诲吗
YN-S00147
void slove() {
ans = 0;
cin >> n;
maxc = n / 2;
YN-S00384
void slove() {
cin >> n;
memset(s, 0, sizeof(s));
memset(f, 0, sizeof(f));
I love Nagato Yuki forever!!!
YN-S00165
该选手所有代码的前两行都是:
//I love Nagato Yuki forever!!!
//Finish at time
面积 luogu 联系
YN-S00085
该选手所有代码前都加入了如下字符串:
//by haotian,sun
//面积luogu联系 @fkxr(uid=995934)
#include<bits/stdc++.h>
#define endl cerr<<"I love Olympiad in Informatics!\n"