結果
問題 |
No.1121 Social Distancing in Cinema
|
ユーザー |
|
提出日時 | 2020-07-22 22:14:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 828 bytes |
コンパイル時間 | 5,262 ms |
コンパイル使用メモリ | 118,464 KB |
最終ジャッジ日時 | 2025-01-12 03:05:49 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 WA * 38 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:36:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wformat=] 36 | printf("%d\n",res.size()); | ~^ ~~~~~~~~~~ | | | | int std::vector<int>::size_type {aka long unsigned int} | %ld
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <cstdio> #include <ctime> #include <assert.h> #include <chrono> #include <random> #include <numeric> #include <set> #include <deque> using namespace std; typedef long long int ll; typedef unsigned long long ull; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector<int> x(n),y(n); map<pair<int,int>,vector<int>> mp; for(int i=0;i<n;i++){ cin >> x[i] >> y[i]; mp[make_pair(x[i]%9,y[i]%9)].push_back(i+1); } vector<int> res; for(auto p:mp){ if(p.second.size()>res.size()){ res=p.second; } } printf("%d\n",res.size()); for(int i=0;i<res.size();i++){ printf("%d ",res[i]); } printf("\n"); }