Submission #67514738
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int INF=0x3f3f3f3f; const ll LLINF=0x3f3f3f3f3f3f3f3fLL; const int MAX=3000+10; int main() { int n,i; ll len; char s[2]; scanf("%d",&n); string res=""; for(i=1;i<=n;i++) { scanf("%s%lld",s,&len); while(len>0) { if(res.size()>101) break; res+=s[0]; len--; } } if(res.size()<=100) cout<<res<<"\n"; else puts("Too Long"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - String Too Long |
User | tokitsukaze |
Language | C++ 20 (gcc 12.2) |
Score | 200 |
Code Size | 491 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3868 KiB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d",&n); | ~~~~~^~~~~~~~~ Main.cpp:17:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%s%lld",s,&len); | ~~~~~^~~~~~~~~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3484 KiB |
00_sample_01.txt | AC | 1 ms | 3676 KiB |
00_sample_02.txt | AC | 1 ms | 3868 KiB |
00_sample_03.txt | AC | 1 ms | 3672 KiB |
01_test_00.txt | AC | 1 ms | 3684 KiB |
01_test_01.txt | AC | 1 ms | 3748 KiB |
01_test_02.txt | AC | 1 ms | 3676 KiB |
01_test_03.txt | AC | 1 ms | 3668 KiB |
01_test_04.txt | AC | 1 ms | 3692 KiB |
01_test_05.txt | AC | 1 ms | 3680 KiB |
01_test_06.txt | AC | 1 ms | 3676 KiB |
01_test_07.txt | AC | 1 ms | 3684 KiB |
01_test_08.txt | AC | 1 ms | 3744 KiB |
01_test_09.txt | AC | 1 ms | 3664 KiB |
01_test_10.txt | AC | 1 ms | 3672 KiB |
01_test_11.txt | AC | 1 ms | 3488 KiB |
01_test_12.txt | AC | 1 ms | 3564 KiB |
01_test_13.txt | AC | 1 ms | 3680 KiB |
01_test_14.txt | AC | 1 ms | 3568 KiB |
01_test_15.txt | AC | 1 ms | 3744 KiB |
01_test_16.txt | AC | 1 ms | 3676 KiB |
01_test_17.txt | AC | 1 ms | 3676 KiB |