原创 UVA Fractions Again?! UVA - 10976
#include <stdio.h> int main(void) { int n, x, y; int a[10000], b[10000]; while(scanf("%d", &n) != EOF){
原创 MNIST數字識別
用keras重做了一遍kaggle上的mnist數字識別,正確率98%仍有待提高 學了一下怎麼從csv轉到numpy中的array,這裏利用了pandas的DataFrame做中轉,將csv和array相互轉換。不得不說自己數值處
原创 Division UVA - 725
#include <string.h> #include <stdio.h> int a[10]; int fun(int x, int y) { if(x < 10000) a[0] ++; if(y <
原创 numpy基礎操作
numpy的屬性 ndim維度 shape形狀 size元素個數 數組創建 創建 np.array([1, 2, 3]) np.array([[1, 2, 3], [4, 5, 6]]) 指定數據類型(int64) np.arr
原创 HDU 1.2.8 AC ME
通過遍歷數組來避免冗長的代碼。 #include <string.h> #include <stdio.h> char a[100001]; int main(void) { char let[30];
原创 HDU 1.3.5 Saving HDU(貪心算法)
Input 輸入包含多個測試實例,每個實例的第一行是兩個整數v和n(v,n<100),分別表示口袋的容量和寶貝的種類,接着的n行每行包含2個整數pi和mi(0<pi,mi<10),分別表示某種寶貝的單價和對應的體積,v爲0的時候結束輸入。
原创 C語言 return不等式
#include <stdio.h> int fun(int a, int b) { return a < b; } int main(void) { int a, b; while(scanf("%d%d", &
原创 python基礎語法
變量與編碼 ‘#’ 註釋 字符串可用’ 或者" "註釋,用\轉義字符來標識 ’ 或 " 布爾值爲 True 和 False,可以用and or 和 not (與或非)運算 空值:None,不等同於0,空值是一個特殊的數值,0有特殊
原创 UVA Digit Counting UVA - 1225
循環內部只定義了一個變量i,在進行取數字計數的時候改變了i的值--TLE的原因。 #include <stdio.h> #include <string.h> int main(void) { int n, num, i, j;
原创 UVA Hangman Judge UVA - 489
錯7次結束 我的代碼: #include <stdio.h> #include <string.h> char let[1000]; char str[1000]; int main(void) { int n; whil
原创 HDU How many prime numbers
Problem Description Give you a lot of positive integers, just to find out how many prime numbers there are. Output
原创 HDU 1.3.6 悼念512汶川大地震遇難同胞--買米
#include <stdio.h> int main(void) { int m, i; scanf("%d", &m); for(i = 1; i <= m; i++){ double mon
原创 HDU The 3n + 1 problem
Consider the following algorithm: 1. input n 2. print n 3. if n = 1 then STOP 4.
原创 UVA All in All 10340
題目描述 輸入兩個字符串s和t,判斷是否可以從t中刪除0個或者多個字符(其他字符順序不變),得到字符串s。例如,abcde可以得到bce,但無法得到cb。 Input 輸入多組數據 每組一行包含兩個字符串s和t,兩字符串之間用空格隔開