Try   HackMD

2024 去打學弟的免修考

scoreboard

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

幫那位沒上的學弟QQ

寫題順序

到著寫

pEpA
Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

賽前

中午例行跑去社部補充肚子體力值,聽到英耀老師說要考免修考,302會斷網
然後這天又是成大講座的時間
我想說反正成大是12:20開始,免修是12:10開始
結果server時間慢5min,輸光

題目

pA 皇后

西洋棋皇后走法,可以上下左右、斜線
給你兩個點,求皇后最快走幾次可以走到
範例輸入1:

3 4 3 4

範例輸出1:

0

範例輸入2:

2 4 5 8

範例輸出2:

2

根本TOJ 674
稍微觀察一下題目就會發現

  • 兩個同樣的點答案為0
  • 假如斜線、同一行列答案就是1
  • 剩下來為2

因為要趕成大,忘記判同一行列,輸光

code
#include <iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; if(a == c && b == d) cout << "0\n"; else if(a == c || b == d || abs(c-a) == abs(d-b)) cout << "1\n"; else cout << "2\n"; }

pB 盜墓筆記

pC 遊戲選角

給你n個人,然後給其攻擊力以及防禦力
其能力值為其二能力之平方和
求能力值第二名的人的攻擊力跟防禦力

後來想想這題也是可以用維護做出來的
// sort裸題,但需要一點點pair概念

code
#include <iostream> #include <vector> #include <algorithm> using namespace std; bool cmp(pair<int, int> a, pair<int, int> b) { return a.first * a.first + a.second*a.second > b.first * b.first + b.second * b.second; } int main() { int n; cin >> n; vector<pair<int, int> > v(n); for(int i = 0; i < n; i++) { cin >> v[i].first >> v[i].second; } sort(v.begin(), v.end(), cmp); cout << v[1].first << ' ' << v[1].second << '\n'; }

pD 地毯編織

給二數

N
M
請輸出一地毯 (編織交錯)

3 4
=#=#
#=#=
=#=#

根本TOJ 247
只是變成長方形而已
簡單觀察一下就會發現 規律在

(i+j)%2

code
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; for(int i = 1; i <= a; i++) { for(int j = 1; j <= b; j++) { if((i+j)%2) cout << '='; else cout << '#'; } cout << '\n'; } }

pF 秘密差簡單版

給一數,求他奇數位 - 偶數位 之絕對值

隨便做一做就行了

code
#include <iostream> using namespace std; int main() { string s; cin >> s; int ans = 0; for(int i = 0; i < s.size(); i++) ans += (s[i]-'0')*(i%2 ? -1 : 1); cout << abs(ans) << '\n'; }

整體感覺

比去年我考的簡單了一點點
但是報考的人只有數資班的3個學弟