Try   HackMD

CP editor / competitive companion

這個是方便我們寫題目的好東西!!
安裝 CP editor 可以順便包 mingw (也會順便包到環境變數,安裝這個可能還比直接安裝mingw快??)

CP editor

用過就回不去了!!

(( 好看介面也是 寫題目的動力 ))

  • 好處是不需要存檔也可以編譯!!
  • 畫面好看!!
  • 輸入輸出有方便的介面寫
  • 下載超快,還幫你用環境 mingw
  • 搭配 template 跟套件,直接變成懶人

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 →

首先請到 CP editor 官網安裝 (先別按下載)
https://cpeditor.org/zh_tw/download/

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 →

注意請選擇包有 mingw 的

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 →

我習慣用黑色的,可以自己用自己喜歡的

檢查環境變數

然後案 win + q 搜尋環境變數

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 →

到系統變數找到 path

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 →

對他點兩下,請確定有 cpeditor mingw bin

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 →

如果沒有,請你在旁邊新增把你下載的 cpeditor\mingw64\bin 路徑貼上去

關掉 CP editor 重開

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 →

隨便打個 hello world,並且在右邊輸入欄位隨便打東西進去

按下下方編譯並且執行,確定可以使用!!

template

想要偷懶的話你可以先打上 template.cpp 把你想要每次出現的樣板打好然後存檔。

到選項 偏好設定 程式語言 c++ c++樣板,把你的 template.cpp 路徑貼上去

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 →

這樣你新增 (ctrl + n) 一個程式碼就會出現你的 template 樣板了!!

Competitive companion

可以幫助你直接一鍵把題目用在編譯器上面。

https://chromewebstore.google.com/detail/competitive-companion/cjnmckjndlpiamhfimnnjmnckgghkjbl?pli=1

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 →

新增到你的擴充

再來到我們的 ncuma judge 登入後隨便選一個題目

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 →

按下他旁邊的三個點 -> parse with -> problem parse

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 →

滑到最下面,唯一一個Q開頭的,找到我們oj的 QDUOJ 按下去

也可以弄成預設

點選選項

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 →

在 Custom rules 裡面,左邊貼上 https://ncuma-oj.math.ncu.edu.tw/
右邊選擇 QDUOJ

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 →

你就會發現你剛剛的 cp editor 幫你開了一個,還會記錄這題的相關資訊

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 →

debug 技巧

除了使用 cout 直接看之外,可以使用cerr (用法跟cout一樣)

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 →

會發現你 cerr 的東西會出現在訊息欄位!!! 紅色的 4 跟 7

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 →

請注意我們的 OJ 還是會看到 cerr 的內容,請寫完後要記得刪除 cerr 的東西

確定成功後,你就可以複製貼上去 ncuma oj 了!!