Submission #95472

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
954722019-02-01 13:23:58Retro3014Bitaro’s Party (JOI18_bitaro)C++17
100 / 100
1713 ms420948 KiB
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <queue>
using namespace std;
#define MAX_N 100000
int N, M, Q;
int Y, SQ;
vector<int> gp[MAX_N+1];
vector<pair<int, int> > edge;
struct S{
S (int idx, int data) : idx(idx), data(data) {}
int idx, data;
bool operator <(const S &a)const{
if(data==a.data){
return idx<a.idx;
}
return data<a.data;
}
};
vector<S> vt[MAX_N+1];
struct QUERY{
int t, y;
vector<int> c;
};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'void solve_query(QUERY)':
bitaro.cpp:50:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int j=0; j<gp[i].size(); j++){
                 ~^~~~~~~~~~~~~
bitaro.cpp:58:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(idx<vt[now.t].size()){
         ~~~^~~~~~~~~~~~~~~~~
bitaro.cpp:62:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(idx==vt[now.t].size()) printf("-1\n");
      ~~~^~~~~~~~~~~~~~~~~~
bitaro.cpp: In function 'void solve()':
bitaro.cpp:78:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<edge.size(); i++){
               ~^~~~~~~~~~~~
bitaro.cpp:81:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0; j<vt[p.second].size(); j++){
                ~^~~~~~~~~~~~~~~~~~~~
bitaro.cpp:86:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while((idx1<vt[p.first].size() || idx2<tmpv.size()) && vt[p.second].size()<SQ){
          ~~~~^~~~~~~~~~~~~~~~~~~
bitaro.cpp:86:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while((idx1<vt[p.first].size() || idx2<tmpv.size()) && vt[p.second].size()<SQ){
                                     ~~~~^~~~~~~~~~~~
bitaro.cpp:86:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while((idx1<vt[p.first].size() || idx2<tmpv.size()) && vt[p.second].size()<SQ){
                                                          ~~~~~~~~~~~~~~~~~~~^~~
bitaro.cpp:87:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(idx1==vt[p.first].size()){
       ~~~~^~~~~~~~~~~~~~~~~~~~
bitaro.cpp:93:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    }else if(idx2==tmpv.size()){
             ~~~~^~~~~~~~~~~~~
bitaro.cpp:115:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0; j<vt[p.second].size(); j++){
                ~^~~~~~~~~~~~~~~~~~~~
bitaro.cpp: In function 'int main()':
bitaro.cpp:143:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<Query.size(); i++){
               ~^~~~~~~~~~~~~
bitaro.cpp:122:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d", &N, &M, &Q);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
bitaro.cpp:125:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &a, &b);
   ~~~~~^~~~~~~~~~~~~~~~
bitaro.cpp:132:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &tmp.t, &tmp.y);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
bitaro.cpp:137:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d", &x); tmp.c.push_back(x);
    ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...