제출 #262136

#제출 시각아이디문제언어결과실행 시간메모리
262136amiratou팀들 (IOI15_teams)C++14
0 / 100
4081 ms364200 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int n,a[100005],b[100005]; vector<int> vec[100005]; void init(int N, int A[], int B[]) { n=N; for (int i = 0; i < n; ++i) { a[i]=A[i]; b[i]=B[i]; } for (int i = 1; i <= n; ++i) for (int j = 0; j < n; ++j) if(a[j]<=i && i<=b[j])vec[i].pb(j); } int can(int M, int K[]) { sort(K,K+M); srand(time(0)); for (int i = 0; i < M; ++i) { set<int> myset; ll sum=0; for (int j = i; j < M; ++j) { sum+=K[j]; for(auto it:vec[K[j]]) myset.insert(it); if(myset.size()<sum)return 0; } } for (int i = 0; i < M; ++i) { set<int> myset; ll sum=0; for (int j = 0; j < M; ++j) { if(rand()&1)continue; sum+=K[j]; for(auto it:vec[K[j]]) myset.insert(it); if(myset.size()<sum)return 0; } } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:24:12: warning: conversion from 'time_t' {aka 'long int'} to 'unsigned int' may change value [-Wconversion]
   24 |  srand(time(0));
      |        ~~~~^~~
teams.cpp:34:19: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   34 |    if(myset.size()<sum)return 0;
      |       ~~~~~~~~~~~~^~~~
teams.cpp:47:19: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   47 |    if(myset.size()<sum)return 0;
      |       ~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...