結果
| 問題 |
No.1121 Social Distancing in Cinema
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-22 22:17:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 830 bytes |
| コンパイル時間 | 1,159 ms |
| コンパイル使用メモリ | 119,156 KB |
| 最終ジャッジ日時 | 2025-01-12 03:07:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 WA * 28 |
コンパイルメッセージ
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]%10,y[i]%10)].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");
}