結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー Zu_rinZu_rin
提出日時 2020-05-06 21:06:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 775 bytes
コンパイル時間 729 ms
コンパイル使用メモリ 83,356 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-16 07:27:49
合計ジャッジ時間 1,951 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 WA -
testcase_21 AC 1 ms
4,380 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int Search(std::map<int, int>&)’ 内:
main.cpp:25:1: 警告: 制御が非 void 関数の終りに到達しました [-Wreturn-type]
   25 | }
      | ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <map>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30

using namespace std;
typedef long long ll;
typedef pair<int, int> pp;

int Search(map<int, int> & mp) {
	for (auto it = mp.begin(); it != mp.end(); it++) {
		if ((*it).second == 1) {
			return (*it).first;
		}
	}
}

int main(void) {
	int num, i, a, b;
	map<int, int> x, y;
	rep(i, 3) {
		cin >> a >> b;
		x[a]++;
		y[b]++;
	}
	if (x.size() != 2 || y.size() != 2)
		printf("-1\n");
	else {
		cout << Search(x) << " ";
		cout << Search(y) << "\n";
	}
	return 0;
}
0