Код: Выделить всё
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
< /code>
В моих тестах это ускоряет время выполнения, но есть ли тестовый пример, который я должен беспокоиться, включив это? Допустимо использовать функции одновременного c stdio и c ++ iostream, если sync_with_stdio Код: Выделить всё
printfКод: Выделить всё
#include
#include
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int w;
scanf("%d",&w);
char crap=getchar();
while(w--){
string a;
getline(cin,a);
int t=1,i;
if((a.length()==1)||(a.length()==2))
printf("Bad\n");
else{
for(i=0;i
Подробнее здесь: [url]https://stackoverflow.com/questions/31162367/significance-of-ios-basesync-with-stdiofalse-cin-tienull[/url]
Мобильная версия