제출 #1068339

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10683392024-08-21 09:21:43farukNaval battle (CEOI24_battle)C++17
0 / 100
1817 ms307180 KiB
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
map<int, int> get_compression(vector<int> vals) {
map<int, int> out;
sort(all(vals));
vals.erase(unique(all(vals)), vals.end());
for (int i = 0; i < vals.size(); i++)
out[vals[i]] = i;
return out;
}
struct ship {
char c;
int x, y, idx;
ship() {}
ship(char c, int x, int y) : x(x), y(y), c(c) {}
bool operator<(const ship& b) const {
return pii(x, y) < pii(b.x, b.y);
}
bool operator==(const ship&b) const {
return idx == b.idx;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Main.cpp: In function 'std::map<int, int> get_compression(std::vector<int>)':
Main.cpp:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for (int i = 0; i < vals.size(); i++)
      |                     ~~^~~~~~~~~~~~~
Main.cpp: In constructor 'ship::ship(char, int, int)':
Main.cpp:21:12: warning: 'ship::y' will be initialized after [-Wreorder]
   21 |     int x, y, idx;
      |            ^
Main.cpp:20:10: warning:   'char ship::c' [-Wreorder]
   20 |     char c;
      |          ^
Main.cpp:23:5: warning:   when initialized here [-Wreorder]
   23 |     ship(char c, int x, int y) : x(x), y(y), c(c) {}
      |     ^~~~
Main.cpp: In constructor 'deathh::deathh(ship, ship, int)':
Main.cpp:36:13: warning: 'deathh::b' will be initialized after [-Wreorder]
   36 |     ship a, b;
      |             ^
Main.cpp:35:9: warning:   'int deathh::tim' [-Wreorder]
   35 |     int tim;
      |         ^~~
Main.cpp:38:5: warning:   when initialized here [-Wreorder]
   38 |     deathh(ship a, ship b, int tim) : a(a), b(b), tim(tim) {}
      |     ^~~~~~
Main.cpp: In constructor 'helper::helper(int, std::set<ship>&, std::set<ship>::iterator)':
Main.cpp:90:16: warning: 'helper::id2' will be initialized after [-Wreorder]
   90 |     set<ship>& id2;
      |                ^~~
Main.cpp:88:25: warning:   'std::set<ship>::iterator helper::a' [-Wreorder]
   88 |     set<ship>::iterator a;
      |                         ^
Main.cpp:91:5: warning:   when initialized here [-Wreorder]
   91 |     helper(int id, set<ship> &id2, set<ship>::iterator a) : id(id), id2(id2), a(a) {}
      |     ^~~~~~
#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...