結果

問題 No.3029 オイラー標数
ユーザー tokitsukaze
提出日時 2025-02-21 21:44:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 717 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 2,419 ms
コンパイル使用メモリ 210,588 KB
実行使用メモリ 38,144 KB
最終ジャッジ日時 2025-02-21 21:44:32
合計ジャッジ時間 13,544 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d",&q);
      |         ~~~~~^~~~~~~~~
main.cpp:16:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |                 scanf("%d%d%d",&x[0],&x[1],&x[2]);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3fLL;
const int MAX=2e5+10;
int main()
{
	int q,a,b,c,x[3];
	scanf("%d",&q);
	set<int> v;
	set<pair<int,int>> e;
	set<tuple<int,int,int>> f;
	while(q--)
	{
		scanf("%d%d%d",&x[0],&x[1],&x[2]);
		sort(x,x+3);
		a=x[0];
		b=x[1];
		c=x[2];
		v.insert(a);
		v.insert(b);
		v.insert(c);
		e.insert({a,b});
		e.insert({b,c});
		e.insert({a,c});
		f.insert(tuple<int,int,int>{a,b,c});
	}
	printf("%d\n",(int)v.size()-(int)e.size()+(int)f.size());
	return 0;
}
0