제출 #1100623

#제출 시각아이디문제언어결과실행 시간메모리
1100623vjudge1이상한 기계 (APIO19_strange_device)C++17
0 / 100
1 ms2560 KiB
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; typedef double db; #define ios_sync ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); #define pb push_back #define F first #define S second #define all(x) (x).begin(), (x).end() #define int ll using namespace std; int n; int x[300007], y[300007]; set<int> sx, sy; map<int, vector<int>> mpx; map<int, int> cy, cx; set<pair<int, int>> s; void solve() { cin >> n; for (int i = 1; i <= n; i++) { cin >> x[i] >> y[i]; if (s.find({x[i], y[i]}) == s.end()) { s.insert({x[i], y[i]}); sx.insert(x[i]); sy.insert(y[i]); mpx[x[i]].pb(y[i]); cy[y[i]]++; cx[x[i]]++; } } int ans = 0; for (auto now : sx) { sort(all(mpx[now])); for (int i = 0; i < mpx[now].size(); i++) { int cur = mpx[now][i]; ans += (cx[now] - 1) * (cy[cur] - 1); } } cout << ans; } signed main() { ios_sync int test = 1, count = 1; while (test--) { solve(); if (test) { cout << '\n'; count++; } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

strange_device.cpp: In function 'void solve()':
strange_device.cpp:38:27: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |         for (int i = 0; i < mpx[now].size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...