版本比较
总结
正文
增加 4 行删除 4 行
36 行未改动3738394041414243444519 行未改动6566676869697071727391 行未改动165166167168169169170171172173174174175176177178105 行未改动全部展开36 行未改动 } sort(a + 1 , a + 5 + 1 , cmp) ; cout << a[1].id << " " << a[1].f ;return 0 ;} }```
# P1428 小鱼比可爱
19 行未改动 { cin >> a[i] ; for(int j = i ; j >= 1 ; j--) { if(a[j] < a[i]) ans[i]++ ; if(a[j] < a[i]) ans[i]++ ; } } for(int i = 1 ; i <= n ; i++) {91 行未改动 cin >> b[i] ; if(a[i] == 1 && b[i] == 0) cnt++ ; if(a[i] == 0 && b[i] == 1) cnt1++ ; }
if((cnt1 % 2 == 0 && cnt % 2 != 0) || (cnt1 % 2 != 0 && cnt % 2 == 0)) cout << -1 << endl ; else if(cnt1 % 2 == 1 && cnt % 2 == 1) cout << cnt1 / 2 + cnt / 2 + 2 << endl ; else cout << cnt1 / 2 + cnt / 2 << endl ; }
return 0 ;}```# P1281 [CERC1998] 书的复制105 行未改动全部展开