- 唐诗晴 的部落格
2025 CSP-J GD 迷惑行为大赏
- @ 2025-11-19 23:50:52
2025 CSP-J GD 迷惑行为大赏
(未完待续,已查看至 GD-J00066)
GD-J00008
polygon
#include<bits/stdc++.h>
using namespace std;
int n,arr[5050],ans;
int main(){
freopen("polygon.in","r",stdin);
freopen("polygon.out","w",stdout);
cin>>n;
for(int i=0;i<n;i++) cin>>arr[i];
if(n<3){
cout<<0;
return 0;
}
if(n==3){
int x=max(arr[0],max(arr[1],arr[2]));
if(arr[0]+arr[1]+arr[2]>x*2) cout<<1;
else cout<<0;
return 0;
}
if(n<=10){
//3
if(n>=3){
for(int i=0;i<=7;i++){
int maxn=0,sum=0;
for(int j=0;j<3;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<3;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
//4
if(n>=4){
for(int i=0;i<=n-4;i++){
int maxn=0,sum=0;
for(int j=0;j<4;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<4;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
//5
if(n>=5)for(int i=0;i<=n-5;i++){
int maxn=0,sum=0;
for(int j=0;j<5;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<5;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
//6
if(n>=6){
for(int i=0;i<=n-6;i++){
int maxn=0,sum=0;
for(int j=0;j<6;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<6;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
//7
if(n>=7){
for(int i=0;i<=n-7;i++){
int maxn=0,sum=0;
for(int j=0;j<7;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<7;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
//8
if(n>=8){
for(int i=0;i<=n-8;i++){
int maxn=0,sum=0;
for(int j=0;j<8;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<8;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
//9
if(n>=9){
for(int i=0;i<=n-9;i++){
int maxn=0,sum=0;
for(int j=0;j<9;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<9;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
//10
if(n==10){
for(int i=0;i<=n-10;i++){
int maxn=0,sum=0;
for(int j=0;j<10;j++){
if(arr[i+j]>maxn)maxn=arr[i+j];
}
for(int j=0;j<10;j++){
sum+=arr[i+j];
}
if(sum>2*maxn) ans++;
}
}
}
cout<<ans;
return 0;
}
“宁可错杀一千,绝不放过一个!”
GD-J00010
number
#include<bits/stdc++.h>
using namespace std;
string a;
long long aa[1000005],ii=0,aaa;
int main(){
freopen("number.in","r",stdin);
freopen("number.out","w",stdout);
cin >> aaa;
cout << aaa;
return 0;
}
《归还于你 赐予给 我的所有 爱与回忆》
seat
#include<bits/stdc++.h>
using namespace std;
long long aa[1005],n,m,ii=0;
int main(){
freopen("seat.in","r",stdin);
freopen("seat.out","w",stdout);
cin >> n >> m;
for(int i = 1;i <= n*m;i++){
cin >> aa[i];
}
if(aa[1] == 1){
if(m % 2 != 0){
cout << m << " " << n;
}else{
cout << m << " 1";
}
}else if(aa[1] == n*m){
cout << "1 1";
}else if(n == 1){
int i;
for(i = 1;i <= m;i++){
if(aa[1] > aa[i]){
ii = i - 1;
}
}
cout << "1 " << ii;
}else if(m == 1){
int i;
for(i = 1;i <= n;i++){
if(aa[1] > aa[i]){
ii = i - 1;
}
}
cout << ii << " 1" ;
}else if(n == 2&& m == 2){
if(aa[1] < aa[2] && aa[1] > aa[3] && aa[1] > aa[4]){
cout << "1 2";
}else if(aa[1] > aa[2] && aa[1] < aa[3] && aa[1] > aa[4]){
cout << "1 2";
}else if(aa[1] > aa[2] && aa[1] > aa[3] && aa[1] < aa[4]){
cout << "1 2";
}else if(aa[1] > aa[2] && aa[1] < aa[3] && aa[1] < aa[4]){
cout << "2 2";
}else if(aa[1] < aa[2] && aa[1] > aa[3] && aa[1] < aa[4]){
cout << "2 2";
}else if(aa[1] < aa[2] && aa[1] < aa[3] && aa[1] > aa[4]){
cout << "2 2";
}
}else{
int i;
for(i = 1;i <= m;i++){
if(aa[1] > aa[i]){
ii = i - 1;
}
}
if(ii / n % 2 == 0){
cout << ii / n + 1 << " " << ii % n + 1;
}else{
cout << ii / n + 1 << " " << n - ii % n;
}
}
return 0;
}
程序最擅长的就是重复,俺也一样
GD-J00013
seat
// freopen("seat.in","w",stdout);
?
GD-J00014
seat
for(int i=1;i<=n*m;i++){
cin>>a[i];
}
if(n==2&&m==2&&a[1]==99){
cout<<1<<" "<<2<<endl;
return 0;
}
if(n==2&&m==2&&a[1]==98){
cout<<2<<" "<<2<<endl;
return 0;
}
if(n==3&&m==3&&a[1]==94){
cout<<"3 1"<<endl;
return 0;
}
《最大化利用已知条件》
xor
if(n==100&&k==1){
cout<<63<<endl;
return 0;
}
if(n==985&&k==55){
cout<<69<<endl;
return 0;
}
if(n==197457&&k==222){
cout<<12701<<endl;
return 0;
}
《依旧》
polygon
for(int i=1;i<=n;i++){
cin>>a[i];
b[i]+=a[i]+b[i-1];
}
if(n==5&&a[1]==1){
cout<<9<<endl;
return 0;
}
if(n==5&&a[1]==2){
cout<<6<<endl;
return 0;
}
if(n==20&&a[1]==75){
cout<<1042392<<endl;
return 0;
}
if(n==500&&a[1]==37){
cout<<366911923<<endl;
return 0;
}
《我是如此相信~~~》
GD-J00016
polygon
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("polygon.in","r",stdin);
freopen("polygon.out","w",stdout);
int n,a[5005],sum=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}if(n>=3){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)if(a[i]+a[j]+a[l]>max(max(a[i],a[j]),a[l])*2)sum++;
}if(n>=4){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)for(int k=l+1;k<=n;k++)if(a[i]+a[j]+a[l]+a[k]>max(max(max(a[i],a[j]),a[l]),a[k])*2)sum++;
}if(n>=5){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)for(int k=l+1;k<=n;k++)for(int x=k+1;x<=n;x++)if(a[i]+a[j]+a[l]+a[k]+a[x]>max(max(max(max(a[i],a[j]),a[l]),a[k]),a[x])*2)sum++;
}if(n>=6){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)for(int k=l+1;k<=n;k++)for(int x=k+1;x<=n;x++)for(int y=x+1;y<=n;y++)if(a[y]+a[i]+a[j]+a[l]+a[k]+a[x]>max(max(max(max(max(a[i],a[j]),a[l]),a[k]),a[x]),a[y])*2)sum++;
}if(n>=7){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)for(int k=l+1;k<=n;k++)for(int x=k+1;x<=n;x++)for(int y=x+1;y<=n;y++)for(int X=y+1;X<=n;X++)if(a[X]+a[y]+a[i]+a[j]+a[l]+a[k]+a[x]>max(max(max(max(max(max(a[i],a[j]),a[l]),a[k]),a[x]),a[y]),a[X])*2)sum++;
}if(n>=8){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)for(int k=l+1;k<=n;k++)for(int x=k+1;x<=n;x++)for(int y=x+1;y<=n;y++)for(int X=y+1;X<=n;X++)for(int Y=X+1;Y<=n;Y++)if(a[Y]+a[X]+a[y]+a[i]+a[j]+a[l]+a[k]+a[x]>max(max(max(max(max(max(max(a[i],a[j]),a[l]),a[k]),a[x]),a[y]),a[X]),a[Y])*2)sum++;
}if(n>=9){
for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)for(int l=j+1;l<=n;l++)for(int k=l+1;k<=n;k++)for(int x=k+1;x<=n;x++)for(int y=x+1;y<=n;y++)for(int X=y+1;X<=n;X++)for(int Y=X+1;Y<=n;Y++)for(int I=Y+1;I<=n;I++)if(a[I]+a[Y]+a[X]+a[y]+a[i]+a[j]+a[l]+a[k]+a[x]>max(max(max(max(max(max(max(max(a[i],a[j]),a[l]),a[k]),a[x]),a[y]),a[X]),a[Y]),a[I])*2)sum++;
}if(n==10){
int s=0,maxx=0;
for(int i=1;i<=n;i++){
s+=a[i];
maxx=max(a[i],maxx);
}if(s>maxx*2){
sum++;
}
}cout<<sum;
return 0;
}
显然你的寿命没有你的代码长(
GD-J00020
number
#include<bits/stdc++.h>
#define int long long
//-fsanitize=address,undefined
//g++ 鈥怬2 鈥恠td=c++14 鈥恠tatic .cpp -o test
using namespace std;
const int MAXN = 15;
string str;
int t[MAXN];
signed main(){
// 作者提示:代码略
}
/*
J00020
luogu id:1357680
genshin id(bushi):294815346
娆歌褰曟垜灏变涪杩欓噷浜嗭細
鎰熻J浠婂勾鍙互搴熶簡鍟婏紝1=閮戒笉涓€瀹氭湁浜嗗晩鍝堝搱
琚嚎娈垫爲蹇芥偁鐨勪竴闆嗗樋鍢?
T1:
st:8:30
end:8:42
D:\銆愭暟鎹垹闄ゃ€慱code>fc number4.ans a.out
姝e湪姣旇緝鏂囦欢 number4.ans 鍜?A.OUT
FC: 鎵句笉鍒板樊寮?
T2:
st:8:43
end coding:8:58
end chk:9:04
澶ф牱渚嬫€庝箞杩欎箞姘村晩鍟婂晩
T3:
st:9:08
鎰熻鍍忕嚎娈垫爲鍟?浣嗘槸绾挎鏍戞斁T3浣犲湪骞插槢
鎵€浠ヨ€冭檻鎬濈淮锛屼絾鏄垜鏄偦瀛愭垜鎯充笉鍑烘潵瀵瑰惂
璺充簡
end thinking:9:12
T4:
涓€鐪糳p鍟婏紝浣嗘槸鎴戞槸鍌诲瓙鎴戜笉浼氳浆绉诲晩
鎵€浠ヨ€冭檻dp锛?
鎬庝箞瑕佽€冨埌12鐐瑰晩
鏁版嵁鑼冨洿灏卞緢杩锋儜鎬т簡
5000
鎬庝箞鎰熻鍍忓尯闂磀p锛屽氨鏄痙p[l][r]琛ㄧず鍖洪棿鐨勬柟妗堟暟鍛?
鍝庢湁200pts浜嗘垜鏄笉鏄彲浠ョ櫧鍏颁簡
鎴戝張鎯冲埌绾挎鏍戜簡鎬庝箞鍔炲晩鍟婂晩鍟?
濂藉鎬晩
娆镐笉绠′簡鍏堟暡涓€妫靛啀璇?
鎴戣寰楅《澶氭斁涓猟p浼樺寲鍟婏紝閭e氨鏁蹭竴妫靛惂锛屼笉浜?
ok绾挎鏍戞暡瀹屼簡锛屾劅瑙夌櫧鏁蹭簡鍝堝搱
鎴戜负浠€涔堥偅涔堝啿鍔ㄥ晩锛屼竴涓嬪氨鏁蹭簡锛屽搸鎹㈤鍚?
back to T3:
nowtim: 9:28
娆哥湅涓嬪彲涓嶅彲浠ヤ簩鍒?
濂藉儚涓嶈
娆稿厛鎶婄嚎娈垫爲绮樿繃鍘诲搱鍝堝搱
娉ㄦ剰鍒発鐨勫ぇ灏忓崄鍒嗘湁杩锋儜鎬э紝鑰冭檻logk锛坆ushi
浣犲埆璇达紝寮傛垨杩欑鐜勫鐨勪笢瑗匡紝鎴戝ソ鍍忓彲浠ユ悶涓€涓墠缂€寮傛垨鍜屾暟缁勬潵鐫€
涓嶈
绔熺劧鍙互log鐨勬眰鍑鸿繖涓瓟妗堝悧銆傚ソ澶х殑鑼冨洿鍟婂晩鍟婂晩鍟?
鏄剧劧涓嶅彲浠p瀵瑰惂
娆革紝鏈夊彲鑳藉彲浠ュ晩
鑰冭檻鎷嗕綅锛熷氨鏄妸姣忎釜鏁扮殑绗琲浣嶅紓鎴栬捣鏉ワ紵
涔熶笉琛屽晩
鍝庡厛鎼炰竴涓墠缂€寮傛垨鍚э紝鎰熻鐢ㄧ嚎娈垫爲log澶姡浜?
鍡?
濂戒簡鍐欏嚭鏉ヤ簡
鍐嶆兂鎯冲晩
鎴戝彲浠ュ紑涓€涓寜浣嶇殑寮傛垨鍓嶇紑鍜屾暟缁勫悧
浼间箮涓嶈
绠椾簡鍏堟墦鏆村姏鍚?
瀹屼簡鍟婁粖骞村拰鍘诲勾瑕佸悓鍒嗕簡鎬庝箞鍔炲晩鍟婂晩鍟婂晩鍟?
闅忔満鍖栧浣曪紵
鎴戣寰楀彲浠ュ晩
绠椾簡鎴戞墜鐜╀笅鏍蜂緥鎵炬壘瑙勫緥鍚?
鍝庡憖鍝庡憖鎴戝お鍌讳簡鐪熺殑鎯充笉鍒板晩鍟婂晩鍟婂晩鍟婂晩鍟?
鎹㈤
turn to T4:
nowtim:9:53
鍙戠幇N<=20灞呯劧灏辨湁10涓偣浜嗚繖涓?0pts锛燂紵
鍋氫簡
2^20浣犲彲浠ュ娲讳簡锛侊紒锛?
~~random_shuffle浣犲彲浠ュ惎鍔ㄤ簡~~
2^20 \times N 鎵?e7宸﹀彸鍝囧彲浠ヤ贡鎼炲晩
灏辨槸甯告暟鏈夌偣澶ц€屽凡鍟?
10锛?5鏆村姏鏁插畬浜?
1 1 1 1 0
1 1 1 0 1
1 1 0 1 1
1 0 1 1 1
0 1 1 1 0
0 1 1 1 1
0 1 0 1 1
0 0 1 1 1
濂囨€殑杈撳嚭
end debuging_force: 10:06
鍝堝搱鍝?0pts灏辫繖涔堟按鐏电伒鐨勫埌鎵嬩簡锛燂紵锛燂紵
鍝囪窇鐨勫ソ蹇晩 111ms灏辫窇杩囧ぇ鏍蜂緥浜嗗搱鍝堝搱
杩欎箞杩樻湁涓や釜灏忔椂鍟婂ソ闂插晩
鑰冭檻涓€涓?00閭e潡鍚?
10锛?2 鍜冲椊ing
鍝囧濂藉浜哄挸鍡斤紙bushi
鍝︽垜鎯充笉鍑烘潵鍝堝搱
濂藉惂鎴戝幓鎯充竴涓嬮偅涓?1鐨勭壒娈婃€ц川绠椾簡锛屾兂涓嶅嚭鏉ユ崗
鑰冭檻鍒板叏閮芥槸1鐨勬儏鍐靛槢锛屼篃灏辨槸璇达紝鍏跺疄鍙m>=3鍗冲彲浜?
濡傛灉鎴戞病鏈夋兂閿欑殑璇濓紝閭e氨鏄?$\sum_{i=3]^{i<=N} C_N^i$
涓嶇煡閬撴湁娌℃湁鎯抽敊娆?
鍓╀笅鐨勬垜瑙夊緱鎴戠湡鐨勫彲浠andomshuffle浜嗗搱鍝?
寮€骞?10锛?2
娆歌瀵圭绉?98244353鍙栨ā娆告垜鍒繕浜嗗搱鍝?
閭d笉鏄畬浜嗗悧瑕佸彇妯$殑璇濊鐢ㄩ€嗗厓娆镐絾鏄垜蹇樿閫掓帹寮忎簡
鎴戝張涓嶄細鎵嬫帹瀵瑰惂
鍟婂晩鍟婂晩鍟?
鐥涘け20pts鍟?
绠椾簡涓嶈浜嗗惂锛屽弽姝f垜鏄笉鍙兘鎺ㄥ嚭閫嗗厓鐨勫晩锛屽洜涓烘垜鏄偦瀛?
鏉ㄨ緣涓夎閭d釜閫掓帹寮忔垜鎺ㄤ竴涓嬬畻浜?
鍐嶆悶鍗婁釜灏忔椂灏辨崲棰?
鎴戝ソ鍍忔帹鍑烘潵浜嗭紒
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1 10 45 120 210 252 210 120 45 10 1
1 11 55 165 330 462 462 330 165 55 11 1
1 12 66 220 495 792 924 792 495 220 66 12 1
鈥︹€?
閭f垜灏辨潵閫犱竴缁勬暟鎹惂
閫犲畬浜嗭紝杩囦簡
濂界殑60pts鍒版墜鎴戞斁涓猺andom鐒跺悗婧滀簡鍚?
鎴戣寰桸<=500濡傛灉瑕侀殢鏈虹殑璇濊繕鏄湁鎴忕殑
绗戞鎴戜簡while( 1 ) cout << "I wish my random_shuffle to be AC!";
鍝堝搱
back to T3:
11:00
鍟婂ソ鐥涘晩濂界棝鍟?
涔?
T3鍙鎷垮埌8涓偣搴旇灏辨湁1=浜嗚€?
鍔犳补
鎴戞病娉曟€濊€冧簡濂界棝鍟妛c
绠椾簡鎴戝厛寮€Linux娴嬩竴涓嬪惂鐪熺殑娌℃硶鎬濊€冧簡銆傘€?
娆稿厛鎹㈠紶澹佺焊->鈥滄毚鍔涘嚭濂囪抗鈥?
娴嬪畬浜?1锛?4
濂界棝鍟?
鎷夸笅5涓偣鐗瑰埆瀹规槗锛屼絾鏄垜宸茬粡娌℃硶涓撴敞浜嗗晩鍟婂晩
濂界殑绗竴涓偣鎵撹〃鎵撳嚭鏉ヤ簡11锛?8
鎬庝箞蹇?1:40浜嗘墦涓嶅畬浜嗗晩鍟婂晩
瀹屼簡鍙戠幇T3鎯冲埌浜嗗畬浜?
*/
请使用地球语言编写注释
polygon
else{
while( 1 ) cout << "I wish my random_shuffle to be AC!";
}
《用愿望抹杀愿望》
GD-J00033
xor
#inlcude<bits/c++.h>
using namespace std;
int len[5050]
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>len[i];
cout<<"你可,你可还有何话要说?";
}//再无话说,请速速动手。
}
- 《 #inlcude<bits/c++.h> 》
- 数组声明的分号留下欲言又止的悬念
- 我舍弃暴力,来质问你——
- 兄弟,你文件读写呢?(四份代码都没有!)
GD-J00034
polygon
freopen("ploygon.in", "r", stdin);
freopen("polygon", "w", stdout);
是不是少了点东西?
GD-J00038
xor
if(f&&k==0){cout<<0;return 0;}
else if(n==1&&a[1]!=k){cout<<0;return 0;}
else if(n==1&&a[1]==k){cout<<1;return 0;}
else if(n==2&&(a[1]^a[2])!=k&&a[1]!=k&&a[2]!=k){cout<<0;return 0;}
else if(n==2&&(a[1]^a[2])==k&&a[1]!=k&&a[2]!=k){cout<<1;return 0;}
else if(n==2&&(a[1]^a[2])!=k&&a[1]==k&&a[2]!=k){cout<<1;return 0;}
else if(n==2&&(a[1]^a[2])!=k&&a[1]!=k&&a[2]==k){cout<<1;return 0;}
else if(n==2&&(a[1]^a[2])==k&&a[1]==k&&a[2]!=k){cout<<1;return 0;}
else if(n==2&&(a[1]^a[2])==k&&a[1]!=k&&a[2]==k){cout<<1;return 0;}
else if(n==2&&(a[1]^a[2])!=k&&a[1]==k&&a[2]==k){cout<<2;return 0;}
else if(n==2&&(a[1]^a[2])==k&&a[1]==k&&a[2]==k){cout<<2;return 0;}
属于你的石山(窜了吧?)
GD-J00052
seat
freopen(".in","r",stdin);
freopen(".out","w",stdout);
做好事不留名
GD-J00054
number
/*
RP++!
freopen!!!(last year -100pts 270->170)
8:43 T1 AC
9:58 T2 AC(xiele henguiyide moni,tiaole 40min)
(chonggou le)
(guiyi)
10:25 T3 buhui.
11:13 T3 [30,60)pts goodbye.
11:21 T4 baoli.
11:48 T4 [12,100]pts goodbye.
11:54 T4 I'm back! 24pts goodbye.
goodbye 1=...TAT
T2 n,m<=10???
pw:#Shang4Shan3Ruo6Shui4
bieren kaishi kantile wo haizai shumima.
tai guiyi le.
kaochang tiele fangkuimo.
zhende shiyong jiaodai tie shang qu de.
hai bu shi tou ming jiao.
dangzhu yidui dongxi.
shenzhi fangkuimo mianji zhiyou pingmu de 4/5.
tai guiyi le.
pang bian you shenmi ru yizhi zaijushou.
diyici shi wen zenme da # .
dierci shi ba xiafangyangli dang cheng le
zijide wenjian.
disanci shi wen daimahou yaobuyao jia .cpp .
disici shi wen daima weishenme shurubuliao.
cong 8:30 ju daole 9:48
zui nanbeng:checker.exe zhale.
qing guanzhu luogu 845367 @__QWQ_qwq__ !
zhuwo chuzhong diyici CSP-J2&CSP-S2 1=!
(keyi yong pyl 0pts huan)
if (CSP-J == 3= || CSP-S == 3= ) I = AFO;
HNSF&GDF are so dangerous.
I'm a EZOIer!
*/
累不累?