結果

問題 No.723 2つの数の和
ユーザー Ohnot
提出日時 2018-08-31 06:15:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 513 bytes
コンパイル時間 1,384 ms
コンパイル使用メモリ 160,176 KB
実行使用メモリ 13,764 KB
最終ジャッジ日時 2024-09-13 20:40:47
合計ジャッジ時間 4,954 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 1 TLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

#define print(x) std::cout << x << std::endl

using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){


	int N,X; cin >> N >> X;
	VI a(N,0);
	REP(i,N) cin >> a[i];

	int ans = 0;
	REP(i,N){
		REP(j,N){
			if(a[j] > X || a[i] > X) j = N;
			if(a[i]+a[j] == X) ans++;
		}
	}

	print(ans);

	return 0;

}
0