제출 #960255

#제출 시각아이디문제언어결과실행 시간메모리
960255irmuunPaint By Numbers (IOI16_paint)C++17
32 / 100
1 ms600 KiB
#include<bits/stdc++.h> #include "paint.h" using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() string solve_puzzle(string s,vector<int>c){ int n=s.size(),mn=0; for(int i=0;i<c.size();i++){ mn+=c[i]; } mn+=(int)c.size()-1; vector<int>a(n,-1),b(n,-1); int j=0; for(int i=0;i<c.size();i++){ for(int k=0;k<c[i];k++){ a[j++]=i; } j++; } j=n-1; for(int i=c.size()-1;i>=0;i--){ for(int k=0;k<c[i];k++){ b[j--]=i; } j--; } for(int i=0;i<n;i++){ if(a[i]==-1||b[i]==-1){ s[i]='?'; if(mn==n){ s[i]='_'; } } else if(a[i]==b[i]){ s[i]='X'; } else{ s[i]='?'; } } return s; }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int i=0;i<c.size();i++){
      |                 ~^~~~~~~~~
paint.cpp:21:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=0;i<c.size();i++){
      |                 ~^~~~~~~~~
#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...