Task: | Text Alignment |
Sender: | bubu2006 |
Submission time: | 2024-11-27 17:23:16 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:56:20: warning: statement has no effect [-Wunused-value] 56 | #define debug(...) 42 | ^~ input/code.cpp:74:5: note: in expansion of macro 'debug' 74 | debug(v); | ^~~~~
Code
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; string to_string(string s) { return '"' + s + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename A> string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; } void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef LOCAL #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 42 #endif signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); // RTE if input wrong datatype string s; getline(cin, s); stringstream st(s); vector<string> v; string cur; while (st >> cur) { if (sz(cur)) v.push_back(cur); } debug(v); int curlen = 0; vector<string> curv; for (int i = 0; i < sz(v); i++) { curlen += sz(v[i]) + 1; curv.push_back(v[i]); if (i == sz(v) - 1 || curlen + sz(v[i + 1]) >= 50) { int need = 50 - (curlen - 1); // debug(need); curv.back() = string(need, ' ') + curv.back(); for (int j = 0; j < sz(curv); j++) { cout << curv[j]; if (j != sz(curv) - 1) cout << ' '; } cout << '\n'; curlen = 0; curv.clear(); } } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
zsyadhzdg ke irkyowki nflwfanr... |
correct output |
---|
zsyadhzdg ... |
user output |
---|
zsyadhzdg ke irkyowki ... |
Test 2
Verdict: ACCEPTED
input |
---|
eayoylmki efsqdhm qqvnrd npesu... |
correct output |
---|
eayoylmki ... |
user output |
---|
eayoylmki efsqdhm qqvnrd ... Truncated |
Test 3
Verdict: ACCEPTED
input |
---|
bsvhdnoxlxad f bclsa llq hjrmp... |
correct output |
---|
bsvhdnoxlxad ... |
user output |
---|
bsvhdnoxlxad f bclsa llq ... Truncated |
Test 4
Verdict: ACCEPTED
input |
---|
xoezwspspfdzfasgxlqu f wjzpekp... |
correct output |
---|
xoezwspspfdzfasgxlqu ... |
user output |
---|
xoezwspspfdzfasgxlqu f wjzpekp... Truncated |
Test 5
Verdict: ACCEPTED
input |
---|
bwvfj zmcpktjnmhzevcqtvlg twch... |
correct output |
---|
bwvfj ... |
user output |
---|
bwvfj zmcpktjnmhzevcqtvlg twch... Truncated |
Test 6
Verdict: WRONG ANSWER
input |
---|
yifvbbjczpcnpknimq lttkngpeqsz... |
correct output |
---|
yifvbbjczpcnpknimq ... |
user output |
---|
yifvbbjczpcnpknimq ... Truncated |
Test 7
Verdict: ACCEPTED
input |
---|
fu lzslzio ncbkga nrwuijkbrh x... |
correct output |
---|
fu ... |
user output |
---|
fu lzslzio ncbkga nrwuijkbrh x... Truncated |
Test 8
Verdict: ACCEPTED
input |
---|
azgwjnvgkapltkknwm odostksvqal... |
correct output |
---|
azgwjnvgkapltkknwm ... |
user output |
---|
azgwjnvgkapltkknwm odostksvqal... Truncated |
Test 9
Verdict: ACCEPTED
input |
---|
j mmadidafwkd dckim iwjy bzsso... |
correct output |
---|
j ... |
user output |
---|
j mmadidafwkd dckim iwjy ... Truncated |
Test 10
Verdict: ACCEPTED
input |
---|
barm sykc faxmvycwxs cnxuwpetq... |
correct output |
---|
barm ... |
user output |
---|
barm sykc faxmvycwxs ... Truncated |
Test 11
Verdict: ACCEPTED
input |
---|
ltwg ns j axhacysdjhrpzymwxae ... |
correct output |
---|
ltwg ... |
user output |
---|
ltwg ns j axhacysdjhrpzymwxae ... Truncated |
Test 12
Verdict: ACCEPTED
input |
---|
pgwvxzeztltppuuq siarhxbs mjmr... |
correct output |
---|
pgwvxzeztltppuuq ... |
user output |
---|
pgwvxzeztltppuuq siarhxbs ... Truncated |
Test 13
Verdict: ACCEPTED
input |
---|
xurwjadifyf iijoofrunig zadrff... |
correct output |
---|
xurwjadifyf ... |
user output |
---|
xurwjadifyf iijoofrunig ... Truncated |