2.5h寫了三道題,後面擼c題kmp一直tle t.t三題就三題吧……
a.easy math
靈感突現,想到「無理數與任何數的和都不可能為整數」,居然1a,真是勇氣的試練。
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #includeab.carries10 #include 11 #include
12 #include 13
14using
namespace
std;
1516
intn;
17int
tmp;
1819
intmain() 28}
29if
(flag)
32else35}
36 }
計算兩兩和有多少個進製。卡在了mod取10^9的時候會爆int,無數次wa…
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #includebe.rectangle10 #include 11 #include
12 #include 13
14using
namespace
std;
1516 typedef long
long
ll;17
const
int maxn = 1000010;18
intn;
19int
a[maxn];
20int
h[maxn];
2122
intmain()
29 ll ans = 0;30
for(ll mod = 10; mod <= 1000000000; mod*=10)
34 sort(h, h+n);
35int m = n - 1;36
for(int i = 0; i < n; i++)
40 ans += min(n-i-1, n-m-1
);41}42
}43 printf("
%lld\n
", ans);44}
45 }
和某微軟筆試一樣,確定一邊暴力列舉另一邊。
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #includee補題ing……10 #include 11 #include
12 #include 13
14using
namespace
std;
1516 typedef long
long
ll;17
ll n, m, k;
1819
intmain()
29 ll tmp = min(k-i, m);
30 a = n - i + 1
;31 b = (m + (m - tmp + 1)) * tmp / 2
;32 ans += a *b;33}
34 printf("
%lld\n
", ans);35}
36 }
BNU弱校聯萌 厲兵秣馬
一如既往地水 兩題 a.求兩組點不相交的匹配方案。二分圖匹配問題,km演算法求最小匹配,取權值相反數即可。1 include 2 include 3 include 4 include 5 include 6 include 7 include 8 include 9 include 10 incl...
弱校聯萌十一大決戰之強力熱身
題目鏈結 給出乙個序列a1 a2,a3,a n 問他們的開方的和a 1,a 2,a 3,a n,是否是乙個整數。除非每個數都是平方數,否則一定開方的和不會是個整數 gt的鍋 include include include include include using namespace std int...
GJJ來簽到 (河南多校聯萌 四 )
time limit 1 sec memory limit 128 mb submit 539 solved 109 submit status web board gjj每天都很忙碌,他每天要上班,還要回家燒飯洗衣服。gjj的公司有個要求,每天上班需要打卡,忙碌的gjj有時候會忘記打卡簽到了,導致...