結果
問題 |
No.723 2つの数の和
|
ユーザー |
|
提出日時 | 2018-08-19 17:10:02 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 295 bytes |
コンパイル時間 | 250 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 15:04:42 |
合計ジャッジ時間 | 1,174 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <stdio.h> int main(void) { long n,x,a[100000],t[100001]={0},s=0,i; scanf("%ld%ld",&n,&x); for(i=0;i<n;i++){ scanf("%ld",&a[i]); t[a[i]]++; } for(i=0;i<n;i++)if(x-a[i]>=0&&100000>=x-a[i])s+=t[x-a[i]]; printf("%ld",s); return 0; }