寒假第一場個人賽題解

2021-10-19 18:32:06 字數 2538 閱讀 2300

#include

using

namespace std;

typedef

long

long ll;

int t;

ll a, b, ans, x;

intmain()

ac**:

#include

using

namespace std;

const

int n =

1e5+7;

char sr[n]

;int

main()

if(a >= b)

printf

("0\n");

else

return0;

}

知識點:

1.tolower函式

作用:將大寫字母變成小寫

標頭檔案:#include

定義函式:int tolower(int c);

函式說明:若引數 c 為大寫字母則將該對應的小寫字母返回。

ac**:

#include

using

namespace std;

set diction;

intmain()

else a[i]

=' ';}

stringstream ss

(a);

while

(ss >> b)

diction.

insert

(b);

}for

(set

::iterator p = diction.

begin()

; p != diction.

end();

++p)

cout <<

*p << endl;

return0;

}

ac**:

#include

#include

#include

#define jiechufengyin std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using

namespace std;

typedef

long

long ll;

const

int n =

1e3+7;

ll t, m, n, x, y, ans =0;

ll mmap[n]

[n];

intmain()

}for

(int i =

1;i <= m - x;i ++)}

cout << ans << endl;

}return0;

}

hdu卡cin、cout和scanf、printf卡的比較狠。。。所以上面這個**在hdu裡ac不了。

hduac**:

#include

using

namespace std;

typedef

long

long ll;

const

int n =

1e3+7;

ll t, m, n, x, y, ans =0;

ll mmap[n]

[n];

intmain()

}for

(int i =

1;i <= m - x;i ++)}

printf

("%lld\n"

, ans);}

return0;

}

ac**:

#include

using

namespace std;

const

int maxn =

1000+5

;int g[maxn]

[maxn]

;int flag[maxn]

;int ans[maxn]

;int m, n, t;

bool

dfs(

int u)

} flag[u]=1

; ans[

--t]

= u;

return

true;}

bool

toposort()

return

true;}

intmain()

memset

(flag,0,

sizeof

(flag));

if(toposort()

)else

printf

("no\n");

}return0;

}

暑假集訓 個人賽第一場

g qin shi huang s national road system 題意是給你平面上n個點,每個點代表乙個城市,給你每個城市的人口,修n 1條路讓其連通。有法術可以讓其中免去其中一條路的費用。讓你求是的a b最大的時候的最小花費,其中a是免費的這條路連線的兩個城市的人口之和,b是需要花費的...

個人賽第一場解題總結

a 大王叫我來巡山吶 crawling in process.crawling failed time limit 1000msmemory limit 32768kb64bit io format i64d i64u submit status practice fzu 2167 descript...

VJ個人賽第一場補題 H

描述 我們都知道數字是個好玩意,那麼我們想知道乙個數字能是否能用若干個 或許是乙個 連續的素數之和表示,並且想知道有多少種方法。例如,53 有兩種表示方法 5 7 11 13 17 和 53。現在給你乙個整數 n,你要告訴他這個數字有多少種不同的連續素數和表示方式。輸入 多組資料輸入,每行乙個數字 ...