ZJ代码迷惑
文明人
本来是去找悲伤的故事,结果偶然发现
另外这位选手还有一个叫做FUCK.cpp的
//emm
P.S.这个是一个叫template.cpp的文件
// Problem []: <>
// <>.cpp / <> / <>.in / <>.out
// time limit: 1.0s
// memory limit: 512 MiB
// Author: qwq automaton (luogu uid 13**19)
// Nephren is better than Chtholly and Ithea!!!!!
//
#include <iostream>
#include <cstdlib>
#include <cstdio>
#define FUCK return
#define CCF 0
int main()
{
freopen("<>.in", "r", stdin);
freoepn("<>.out", "w", stdout);
FUCK CCF;
}
i spend my qingchun on it
#include<bits/stdc++.h>
using namespace std;
int n,m,k,v[105];
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(!isdigit(ch))f=ch=='-'?-1:f,ch=getchar();
while(isdigit(ch)) x=x*10+ch-48,ch=getchar();
return x*f;
}
int main()
{
freopen("sequence.in","r",stdin);
freopen("sequence.out","w",stdout);
n=read(),m=read(),k=read();
for(int i=0;i<=m;++i) v[i]=read();
cout<<rand()*114514%998244353;
return 0;
}
//warning!lots of chenglish are comming!(because there is no chinese cin way
//I love Fengming Jiongjun/Mandi Sa forever
//I learnt dijkstra leart LCA learnt segmenttree leart fhqtreap learnt xiongyali and so on
//but..i use nothing in NOIp
//how sad !
//zhou AK is sitting behind me .how lucky is me!(?
//im going to tuiyi tomorrow&it is my last hour of being an oier
//i spend my qingchun on it,but what it return me?
//hope to get 3=.
//&my qq is 34***64627
//Best wishes! Hope all people that look this can AK IOI
//By LAB_***le(luogu name the god of -~i&&~-i
模拟退火yyds
/*
wyh ak NOIP
lxl ak NOIP
cjl ak NOIP
zkj ak NOIP
hjc ak NOIP
wkr ak NOIP
yz ak NOIP
NOIP ak queensi
模拟退火永远的神,30pts应该没问题
*/
#include<bits/stdc++.h>
using namespace std;
int read(){int x=0,f=1;char c=getchar();
for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
for(;isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(c^48);
return x*f;
}
const int N = 1e4+10;
int n,q,dat[N];
const int qwq=1e5+10;
double ans=998244353,sum=0,a[N];
void Upd(int x){
a[x]=a[x+1]+a[x-1]-a[x];
}
void Fsqrt(){double S=0;sum=0;
for(int i=1;i<=n;++i) S+=1.0*a[i];S/=n;
for(int i=1;i<=n;++i) sum+=(a[i]-S)*(a[i]-S);
sum*=1.0*n;
}
void Solve(){
int k=n>=20?n/2:n/3;
for(int i=1;i<=k;++i){int x=rand()%(n-2)+2;
Upd(x);
}
Fsqrt();
}
int main(){
freopen("variance.in","r",stdin);
freopen("variance.out","w",stdout);
srand(NULL);
n=read();
for(int i=1;i<=n;++i) dat[i]=read(),a[i]=dat[i]*1.0;
q=1500011;
for(;q--;){
Solve();
ans=min(ans,sum);
}
printf("%.0lf",ans);
return 0;
}
/*
10
6 19 34 35 56 63 82 82 83 99
20
6 6 6 6 6 6 6 6 6 6 6 19 34 35 56 63 82 82 83 99
*/
rp溢出人
rqy姐姐和蛙
随机算法好!
门磁和铃
注:以上三张是同一个人的代码
退了个寂寞