暑期解題訓練團隊

@problem-solved-sgroup

Public team

Community (0)
No community contribution yet

Joined on Jun 4, 2021

  • C. 完美平方數 #include <iostream> #include <math.h> using namespace std; int numSquares(int n); int main() { int num, ans;
     Like  Bookmark
  • E. 鐵路 本題源自於Onling Judge:514 - Rails 題目目標在於給定出站順序的前提下,利用已知入站順序1~N, 確定是否仍能夠以目標出站順序離開。 有一個簡單的想法,我們利用queue的特性來維護出站順序、 利用stack的特性來維護入站順序, 並依次比較它們的front/top是否相同,如果相同就安排出站(pop)。
     Like  Bookmark
  • C. 組合 #include<bits/stdc++.h> using namespace std; vector<int> a; bool first=true,f=true; fstream input,output; void find(int g,vector<int> &can,int p){ if(!g){ if(!first){
     Like  Bookmark
  • D. Flood Fill # include <bits/stdc++.h> using namespace std; int m[102][102]; struct Fill{ int x,y,t; };
     Like  Bookmark
  • B. 嚴格二元樹 # include <iostream> using namespace std; struct Node{ int val, depth; Node *left, *right; Node(int v, int h){ val = v, depth = h;
     Like  Bookmark
  • A. 括弧組合 與2A題的概念相當,不過目的是在於將「所有的組合」都給生成出來。 可以利用簡單的DFS,將每個狀況皆列舉出來後,再判斷當前組合是否無法形成括弧組合的方式。 # include <bits/stdc++.h> using namespace std; void paren(int n, int l, string s){ if(l<0 || n<0) return;
     Like  Bookmark
  • 學習團隊 DOMjudge 使用說明 行程規畫與出題方式 參與人員 網頁推薦 線上程式題庫推薦 IDE 推薦
     Like  Bookmark
  • 第七次(8/27 ~ 9/10) A. 括弧組合 B. 嚴格二元樹 C. 完美平方數 D. Flood Fill
     Like  Bookmark
  • 第六次(7/30 ~ 8/6) A. 費式數列 B. 理組情侶密碼 C. 組合 D. 傷心水族箱 E. 核戰爭
     Like  Bookmark
  • 時間與空間複雜度 程式解題時的一些常用術語 short full-name AC Accept 答案正確
     Like  Bookmark
  • E. 核戰爭 八皇后問題(Eight Queens Puzzle) #include <iostream> #include <vector> using namespace std; #define MAX 12 struct Point {
     Like  Bookmark
  • D. 傷心水族箱 # include <iostream> # include <vector> # include <algorithm> using namespace std ; vector<int> sati ; vector<int> cost ; int maxS = 0 ;
     Like  Bookmark
  • A. 費式數列(Easy) 因為數量級還很小,所以直接使用遞迴的方式即可處理: #include <iostream> using namespace std; int fib(int n){ if(n<=2) return 1;
     Like  Bookmark
  • D. 黑白棋 本題源自於 程式自學平台:ITSA Online Contest 74th Problem 7. 找出合法棋步 (需先登入才能閱覽題目) 窮舉完每個黑色棋子,並對其進行八個方向的窮舉, 方向的設定可以利用一個8x2的陣列來存起來,這樣在後續利用for迴圈窮舉時會變得比較容易。 # include <iostream> using namespace std;
     Like  Bookmark
  • C. 排列組合 # include <stdio.h> # include <string.h> # include <iostream> using namespace std ; typedef char str30[30] ; str30 ans[50000] ;
     Like  Bookmark
  • D. 神奇函式 Ternary Search # include <iostream> # include <iomanip> using namespace std; int y; double f(double x){ return 6*x*x*x*x*x*x*x + 8*x*x*x*x*x*x + 7*x*x*x + 5*x*x - y*x;
     Like  Bookmark
  • A. 遞增矩陣 # include <bits/stdc++.h> using namespace std ; int main() { int m, n, k, temp ; int i, j ; cin>>m>>n>>k; vector<vector<int>> a ;
     Like  Bookmark
  • B. 理組情侶密碼 #include <iostream> #include <sstream> #include <string> #include <random> #include <ctime> #include <bits/stdc++.h> using namespace std; void CountAndSay(long long &n, const long long &progress, string &result);
     Like  Bookmark
  • D. 預測贏家 本題源自於Leetcode:486. Predict the Winner #include<iostream> #include<vector> #include<math.h> using namespace std ; bool PredictTheWinner( vector<int> nums ) ;
     Like  Bookmark
  • B. 字串解碼 本題源自於Leetcode:394. Decode String # include <iostream> # include <stack> # include <string> # include <sstream> # include <cstdlib> using namespace std ;
     Like  Bookmark