제출 #991412

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9914122024-06-02 08:50:13PCTprobability자리 배치 (IOI18_seats)C++17
0 / 100
4069 ms20136 KiB
#include "seats.h"
#include <bits/stdc++.h>
using namespace std;
#define nd node
struct node{
int sum,mn,cnt;
node(){
sum=0,mn=1000000000,cnt=0;
}
node(int a,int b,int c){
sum=a,mn=b,cnt=c;
}
};
node merge(node a,node b){
node c;
c.sum=a.sum+b.sum;
c.mn=min(a.mn,b.mn+a.sum);
if(c.mn==a.mn) c.cnt+=a.cnt;
if(c.mn==b.mn+a.sum) c.cnt+=b.cnt;
return c;
}
struct segtree{
vector<nd> nod;
int n;
segtree(){
}
segtree(int n_){
n=1;
while(n<n_) n*=2;
nod.resize(2*n);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

seats.cpp: In function 'void give_initial_chart(int, int, std::vector<int>, std::vector<int>)':
seats.cpp:76:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   76 |   for(int i=0;i+1<c.size();i++){
      |               ~~~^~~~~~~~~
seats.cpp: In function 'int swap_seats(int, int)':
seats.cpp:98:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   98 |     if(i<0||i+1>=c.size()) continue;
      |             ~~~^~~~~~~~~~
seats.cpp:108:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  108 |     if(i<0||i+1>=c.size()) continue;
      |             ~~~^~~~~~~~~~
seats.cpp:114:10: warning: variable 'v' set but not used [-Wunused-but-set-variable]
  114 |     auto v=sg.prod(i,i+1);
      |          ^
seats.cpp:85:7: warning: unused variable 'ans' [-Wunused-variable]
   85 |   int ans=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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...