sdnu oj 1301 判斷相等 暴力模擬

2021-10-03 05:43:43 字數 948 閱讀 9917

超級暴力的寫法,去除所有無用的 『0』 字元, 判斷剩下的是否相等, 但是 debug 好久

emmm,python 似乎可以直接讀入比較,自動去除前導 0

#include

#include

#include

#include

#include

#include

#include

#include

#include

#define mod 1000000007

using namespace std;

typedef

long

long ll;

const

int n =

10000006

;const

long

long inf =

0x3f3f3f3f

;const

double eps =

1e-5

;const

double pi =

acos(-

1);string a, b;

void

erasee

(string &a)

//刪除無用的 0

if(a[i]

=='.'

)//說明後置都是 0, '.' 需要刪去

a.erase

(i,1);

return;}

intmain()

else

if(a[0]

=='-'

)else

}else

if(flag)

printf

("yes\n");

else

printf

("no\n");

}return0;

}

SDNU 1301 判斷相等 字串比較數字

給定兩個數a和b 長度不超過100 判斷a和b是否相等。有多組測試資料,每組測試資料佔一行,每行兩個數a和b,由空格隔開。每個測試資料的結果輸出到一行,如果a和b相等輸出 yes 否則輸出 no 00.00 000000 0 0 00000 0.0000 0001 1 2 3000000000000...

SDNUOJ 1076 種類判斷 種類並查集

time limit 1000 ms memory limit 32768 kb description 已知有 n 個學生,其中有男生也有女生,給定 m 個關係,每個關係表示兩個同學性別是否相同。如 同學a 和同學 b 是同性,或不是同性,判斷這些條件中是否存在矛盾。input 第一行為兩個整數 ...

python 兩個list之間判斷是否有相同值

例項 axis 4 slot 1 2,3 4,5 6 atwill7 false for i in axis if i not in slot if atwill7 print 假 else print 真 下列 詳解 1 用 i 去遍歷第乙個列表 axis 如果 i 不在第二個列表 slot 裡面...