Submission #956749

#TimeUsernameProblemLanguageResultExecution timeMemory
956749DeltaStructType Printer (IOI08_printer)C++17
0 / 100
11 ms2140 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<string> A(n); for (auto& a:A) cin >> a; sort(A.begin(),A.end()); string s; cin >> s; for (int i(0);i < n;++i){ int t(0); for (int k(0);;++k,++t) if (A[i-1].size()==k||A[i].size()==k||A[i-1][k]!=A[i][k]) break; if (i) for (int k(t);k < A[i-1].size();++k) s += '-'; for (int k(t);k < A[i].size();++k) s += A[i][k]; } cout << s << endl; for (char a:s) cout << a << endl; }

Compilation message (stderr)

printer.cpp: In function 'int main()':
printer.cpp:9:46: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |     for (int k(0);;++k,++t) if (A[i-1].size()==k||A[i].size()==k||A[i-1][k]!=A[i][k]) break;
      |                                 ~~~~~~~~~~~~~^~~
printer.cpp:9:62: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |     for (int k(0);;++k,++t) if (A[i-1].size()==k||A[i].size()==k||A[i-1][k]!=A[i][k]) break;
      |                                                   ~~~~~~~~~~~^~~
printer.cpp:10:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     if (i) for (int k(t);k < A[i-1].size();++k) s += '-';
      |                          ~~^~~~~~~~~~~~~~~
printer.cpp:11:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int k(t);k < A[i].size();++k) s += A[i][k];
      |                   ~~^~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...