紀中2020 3 4普及C組模擬賽總結

2021-10-03 13:29:27 字數 2711 閱讀 2255

看了一眼資料,o(n

)o(n)

o(n)

的時間複雜度顯然可過

所以——

大膽暴力

拿到了100pt

s100pts

100ptsac

code

ac~code

accode

#include

#include

#include

#include

using

namespace std;

long

long n,ans=

922337203685477

,js;

long

long x[

100010

],y[

100010];

intmain()

for(

int i=

2; i<=n-

1; i++

)printf

("%lld"

,ans)

;return0;

}

發現了正數與負數的巧妙聯絡,

再看一眼資料,o(n

)o(n)

o(n)

的時間複雜度顯然可過

所以——

大膽暴力

拿到100pt

s100pts

100ptsac

code

ac~code

accode

#include

#include

#include

#include

using

namespace std;

long

long n,ans=

999999999

;struct node

boss[

1000010];

intcmp

(const node&aa,

const node&bb)

intmain()

sort

(boss+

1,boss+

1+n,cmp)

;//結構體排序

for(

int i=

2; i<=n; i++)if

(abs

(boss[i]

.b+boss[i-1]

.b)ans=

abs(boss[i]

.b+boss[i-1]

.b);

printf

("%lld"

,ans)

;return0;

}

比賽時輸出樣例

拿了10分。。。

正解:字首和+貪心acc

od

eac~code

accode

#include

#include

#include

#include

using

namespace std;

int ans,c[

1000010

],n,js;

char x;

struct node

e[1000005];

bool

cmp(

const node&l,

const node&r)

intmain()

sort

(e+1

,e+n+

1,cmp)

;//快排,保證最優性。

for(

int i=

1; i<=n; i++

)printf

("%d"

,ans)

;return0;

}

這題我本來可以拿93.3分的!!!

結果神經質多打了個for

forfo

r導致只有40pt

s40pts

40pt

s正解也是模擬acc

od

eac~code

accode

#include

#include

#include

#include

#include

using

namespace std;

int ls,lzs,i,js;

string s,zs;

intmain()

if(js!=-1

)}i++;}

cout

}

騙分失敗,0pt

s0pts

0pts

正解:dp

還沒做a cc

od

eac~code

accode

100

+100+10

+40

=250pt

s100+100+10+40=250pts

100+10

0+10

+40=

250p

ts做完題後如果還有時間要回來看看做過的題目能不能優化。

紀中2020 2 22普及C組模擬賽總結

比賽時就是看不懂題意,然後就棄了。其實就是乙個比較樸素的dp 把問題轉化為可以休息多少時間 正解 dpacc od eac code accode include include include include using namespace std int n,m,f 10000010 struc...

紀中2020 3 8普及C組模擬賽總結

本題暴力枚舉行和列之後求最大即可acac acacc odeac code accode include include include using namespace std int ans,maxn,n,o,m,w,f,x,y char c 1001 1001 intmain if ans ma...

紀中2020 3 11普及C組模擬賽總結

本題我打了個o n 2 o n 2 o n2 的暴力,只拿了8.3分。正解 遞迴acc od eac code accode include include include include using namespace std int n,a,b,ans,v 9000010 voiddg int ...