結果
| 問題 | No.723 2つの数の和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-04 22:05:07 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 514 bytes |
| 記録 | |
| コンパイル時間 | 371 ms |
| コンパイル使用メモリ | 73,468 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-04-08 05:39:04 |
| 合計ジャッジ時間 | 3,657 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 22 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:23: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized]
17 | scanf("%lld",a);
| ~~~~~^~~~~~~~~~
main.cpp:10:16: note: 'a' was declared here
10 | ll N,X,a;
| ^
ソースコード
#include <stdio.h>
#include <iostream>
#include <algorithm>
#define TEN5 100000
typedef long long ll;
int c[TEN5+1];
int main(){
ll N,X,a;
int cnt = 0;
scanf("%lld",&N);
scanf("%lld",&X);
for(int i = 0; i <= TEN5 ; i++) c[i] = 0;
for(int i = 0; i < N; i++){
scanf("%lld",a);
c[a] += 1;
}
for(int i = 0; i <= TEN5 ; i++){
if(X-i <= TEN5) cnt += c[i]*c[X-i];
}
printf("%d\n",cnt);
}