为什么过不了啊啊啊啊啊

xyx008 2025-03-09 20:11:12 1

#include <bits/stdc++.h> using namespace std;

int main() { int n,m; cin >> n >> m; int a[n]; int cnt = 0; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (a[i] + a[j] == m) { cnt ++; } } } cnt /= 2; for(int i = 0;i < n;i ++){ if(a[i] == m){ cnt ++; } } cout << cnt; return 0; }

{{ vote && vote.total.up }}