結果
| 問題 |
No.3029 オイラー標数
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-02-22 02:16:02 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 664 ms / 2,000 ms |
| コード長 | 578 bytes |
| コンパイル時間 | 2,381 ms |
| コンパイル使用メモリ | 210,240 KB |
| 実行使用メモリ | 38,144 KB |
| 最終ジャッジ日時 | 2025-02-22 02:16:17 |
| 合計ジャッジ時間 | 12,667 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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;
}
vjudge1