結果

問題 No.696 square1001 and Permutation 5
コンテスト
ユーザー square1001
提出日時 2018-02-08 20:33:59
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 210 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 261 ms
コンパイル使用メモリ 39,012 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-17 10:34:08
合計ジャッジ時間 1,296 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
int n, a, b, l = 200000, c[400009]; long long ret;
int main() {
	scanf("%d", &n);
	while (n--) {
		scanf("%d %d", &a, &b);
		ret += c[b - a + l];
		c[a - b + l]++;
	}
	printf("%lld\n", ret);
}
0