from pptx import Presentation
def read_first_slide(pptx_file):
prs = Presentation(pptx_file)
text = []
# Process only the first slide
first_slide = prs.slides[0]
for shape in first_slide.shapes:
if hasattr(shape, "text"):
decoded_text = shape.text.encode('utf-8').decode('utf-8', errors='ignore')
text.append(decoded_text)
return "\n".join(text)
# Example usage
pptx_file = "20240130_yuhc.pptx"
first_slide_text = read_first_slide(pptx_file)
print(first_slide_text)
#include <iostream>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int n, m;
cin >> n >> m;
cout << (((n - m) & ((m - 1) >> 1)) == 0 ? 1 : 0) << endl;
}
return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int R;
cin >> R;
vector<int> addresses(R);
for (int i = 0; i < R; ++i)
cin >> addresses[i];
sort(addresses.begin(), addresses.end());
// Calculate the median address
int median;
if (R % 2 == 0) {
median = (addresses[R / 2 - 1] + addresses[R / 2]) / 2;
} else
median = addresses[R / 2];
// Calculate total distance
int total_distance = 0;
for (int i = 0; i < R; ++i)
total_distance += abs(addresses[i] - median);
cout << total_distance << endl;
}
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
typedef vector<vector<int>> Matrix;
Matrix base = {{1, 1}, {1, 0}};
Matrix multiply(const Matrix &a, const Matrix &b, int mod) {
int n = a.size();
int m = b[0].size();
int p = a[0].size();
Matrix result(n, vector<int>(m, 0));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
for (int k = 0; k < p; ++k) {
result[i][j] += (a[i][k] * b[k][j]);
result[i][j] %= mod;
}
}
}
return result;
}
Matrix fibonacciModulo(long long n, int m) {
if (n <= 1) return base;
Matrix result;
if (n & 1)
result = multiply(fibonacciModulo((n >> 1) + 1, m), fibonacciModulo(n >> 1, m), m);
else
result = multiply(fibonacciModulo(n >> 1, m), fibonacciModulo(n >> 1, m), m);
return result;
}
int main() {
long long n;
int m;
while (cin >> n >> m) {
m = 1 << m;
Matrix result = fibonacciModulo(n, 1 << m);
cout << result[0][0] << endl;
}
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
typedef vector<vector<int>> Matrix;
Matrix multiply(const Matrix &a, const Matrix &b, int mod) {
int n = a.size();
int m = b[0].size();
int p = a[0].size();
Matrix result(n, vector<int>(m, 0));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
for (int k = 0; k < p; ++k) {
result[i][j] += (1LL * a[i][k] * b[k][j]) % mod;
result[i][j] %= mod;
}
}
}
return result;
}
Matrix matrixPower(const Matrix &base, long long exponent, int mod) {
if (exponent == 1) return base;
Matrix halfPower = matrixPower(base, exponent >> 1, mod);
Matrix result = multiply(halfPower, halfPower, mod);
if (exponent & 1) result = multiply(result, base, mod);
return result;
}
int fibonacciModulo(long long n, int m) {
if (n <= 1) return n % m;
Matrix base = {{1, 1}, {1, 0}};
Matrix result = matrixPower(base, n - 1, m);
return result[0][0];
}
int main() {
long long n;
int m;
while (cin >> n >> m) {
int result = fibonacciModulo(n, 1 << m);
cout << result << endl;
}
return 0;
}
"%PROGRAMFILES(X86)%\Google\Chrome Remote Desktop\CurrentVersion\remoting_start_host.exe" --code="4/0AeaYSHBKfySwGOytKP3bJt1ZW_RZftVPw00l3gcpTG4jzzWfzruTmKFxojXZE_wmW0xaiA" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=%COMPUTERNAME%
DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/0AeaYSHB9ZQTyZJQGqq91PFM9kWpoYyJFNNYEbQNPRBzhcGxUN-XXmlmIF060E7J7wBikFA" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$(hostname)
摘要比較並評估四種分頁替換演算法(page replacement algorithm),以三種不同的資料型態進行比較,演算法各為 FIFO、ARB、ESC、DESC,資料型態各為Random、Locality、Most Random (MR.)。整體的排名為 (優) DESC > FIFO > ESC > ARB (差),本實驗提出了「先生生成」與 DESC 兩個概念,分別是特殊的資料生成方式和獨特的演算法,如上述 DESC 在表現上比現有的幾個演算法好,但仍有許多進步的空間。
Jun 28, 2024利用 rb-bench,分析不同紅黑樹實作手法的差異,應當考慮更大的資料範圍
Jun 28, 2024contributed by < dockyu >
Jun 27, 2024contributed by < marsh-fish >
Jun 16, 2024or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up