結果

問題 No.3021 データベースの練習
ユーザー masamasa
提出日時 2017-03-31 22:38:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 398 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 70,752 KB
実行使用メモリ 24,228 KB
平均クエリ数 540.42
最終ジャッジ日時 2023-09-23 12:59:33
合計ジャッジ時間 4,760 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
24,192 KB
testcase_01 AC 213 ms
23,964 KB
testcase_02 AC 275 ms
23,664 KB
testcase_03 AC 292 ms
23,868 KB
testcase_04 AC 273 ms
23,568 KB
testcase_05 AC 282 ms
23,460 KB
testcase_06 AC 127 ms
23,964 KB
testcase_07 AC 198 ms
24,228 KB
testcase_08 AC 281 ms
23,940 KB
testcase_09 AC 225 ms
23,556 KB
testcase_10 AC 197 ms
23,784 KB
testcase_11 AC 398 ms
23,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;

int main() {
	int n;
	cin >> n;

	int x1, x2, y1, y2;

	for (int i = 0; i < n; i++) {
		cin >> x1 >> x2 >> y1 >> y2;
		string q = "SELECT count(*) FROM point ";
		       q += "WHERE x BETWEEN " + to_string(x1) + " AND " + to_string(x2) + " ";
		       q +=   "AND y BETWEEN " + to_string(y1) + " AND " + to_string(y2) + ";";
		cout << q << endl;
	}
	return 0;
}
0