답안 #956749

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
956749 2024-04-02T12:24:50 Z DeltaStruct Type Printer (IOI08_printer) C++17
0 / 100
11 ms 2140 KB
#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

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];
      |                   ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Expected integer, but "tptttykduyvxjbzhqup" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 432 KB Expected integer, but "eejzatjmnqxctn--------------hs...-----------n-xxvebmc-------yerx" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Expected integer, but "hjxgqk------iupqiq------ppgqvq...cfafyveyuj------------xrmqggqby" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Expected integer, but "bhvdxrptha----------edczvdgoyf...-------xcdyqxxmomnd-----------p" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 348 KB Expected integer, but "abbblauqkfd----------ed--svhbl...-qgvk----rpwfex------yyauyvyazz" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 1212 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 10 ms 2140 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 11 ms 2136 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -