F.A.Qs Home ProblemSet Status Ranklist Contest LoginRegister
Notice:1:五月份月赛定于5.27日12:30--17:30,欢迎大家来玩! 2:关于OJ的注册可看https://www.lydsy.com/JudgeOnline/wttl/thread.php?tid=5671
大视野在线测评-欢迎您
[ New Thread ]
MainBoard >> 中央滋不滋瓷BZOJ开c++11啊?
ZYQN @ 2017-03-07 19:08:49
[ Quote ] [ Edit ] [ Delete ] 1#
话说c++11有很多非常好的特性啊!
像什么lambda,auto等等,都灰常好用
但BZOJ没有开,这非常不优雅

虽然NOI不让用,不过平时写题就随便一点好不好啊?
或者在语言选项中单独加上c++11也是很好的

这个也不是一个很麻烦的事吧!
中央看我这么热情,一个字不说也不好吧?
干脆就明确地告诉我资瓷吧!
ZYQN @ 2017-03-07 19:11:53
[ Quote ] [ Edit ] [ Delete ] 2#
去查了一查,似乎g++得在4.7以上才能资瓷c++11?那就顺便升级一下编译器吧!
ZYQN @ 2017-03-07 19:12:49
[ Quote ] [ Edit ] [ Delete ] 3#
看看隔壁Codeforces连c++14都资瓷了
BZOJ这么严守NOI的画风良心不会痛嘛(逃
fangcun @ 2017-03-07 19:21:24
[ Quote ] [ Edit ] [ Delete ] 4#
更换编译器影响比较大,可能很多题就可以水过,也可能导致很多题目代码被卡掉
ZYQN @ 2017-03-07 20:26:51
[ Quote ] [ Edit ] [ Delete ] 5#
我们可以像其他OJ一样,在选语言的时候加上一个c++11同时保留c++。
这样大家就可以自由选择了啊!
互不影响,想想也是激动呢!

另外的话,像Claris这种ACM巨犇也在这上面切题玩
加上c++11的选项后,大家可以自由选择嘛!
要不然ACM的有些代码都CE了,ACMer多不高兴啊!?
bdf @ 2017-03-07 20:45:00
[ Quote ] [ Edit ] [ Delete ] 6#
希望有C++14
NiroBC @ 2017-03-07 21:36:21
[ Quote ] [ Edit ] [ Delete ] 7#
我想写出for (auto i : Vector)却发现这是BZOJ
我想写出std::sort(X.begin(), X.end(), [] (const Struct &x, const Struct &y) { return xxxx; });却发现这是BZOJ
我想写出std::pair < int, int > xxx = { a, b };却发现这是BZOJ
我很难过
ZYQN @ 2017-03-07 22:03:01
[ Quote ] [ Edit ] [ Delete ] 8#
@NiroBC 其实我是冲着lambda来的 QwQ
不过一起资瓷了的话,那是最好的
ZYQN @ 2017-03-07 22:03:35
[ Quote ] [ Edit ] [ Delete ] 9#
@dbf 吼啊!那直接干到14去也好啊!
Claris @ 2017-03-07 22:14:58
[ Quote ] [ Edit ] [ Delete ] 10#
我平时ACM比赛也不用C++11特性啊
SW_Wind @ 2017-03-08 07:33:40
[ Quote ] [ Edit ] [ Delete ] 11#
开C++11不如顺便也开Java8算了
Lucida @ 2017-03-08 11:08:31
[ Quote ] [ Edit ] [ Delete ] 12#
你们这么说BZOJ ,让连<bits/stdc++.h>都不兹瓷的POJ等等怎么办
ZYQN @ 2017-03-08 11:53:41
[ Quote ] [ Edit ] [ Delete ] 13#
我们假装有很多ACMer要用c++11的特性好不好啊 QwQ
mcfx @ 2017-03-08 19:06:38
[ Quote ] [ Edit ] [ Delete ] 14#
然而可以
#pragma GCC diagnostic error "-std=c++11"
至少auto可以用
mcfx @ 2017-03-08 19:14:09
[ Quote ] [ Edit ] [ Delete ] 15#
然而bzoj编译器版本太老了吧
wxh010910 @ 2017-03-27 11:52:41
[ Quote ] [ Edit ] [ Delete ] 16#
顶一顶啊
1430586275 @ 2017-03-27 12:57:58
[ Quote ] [ Edit ] [ Delete ] 17#
资辞啊
RiseFalcon @ 2017-03-29 07:05:39
[ Quote ] [ Edit ] [ Delete ] 18#
资瓷(准备Hot
thhyj @ 2017-03-29 16:10:23
[ Quote ] [ Edit ] [ Delete ] 19#
资兹啊(然而并不会用)
xehoth @ 2017-03-29 16:10:42
[ Quote ] [ Edit ] [ Delete ] 20#
不资瓷 C++11,资瓷 C++14,资瓷 C++17
scarlyw @ 2017-03-29 16:10:53
[ Quote ] [ Edit ] [ Delete ] 21#
资瓷啊(然而并不喜欢用)
dcy11011 @ 2017-03-31 21:22:11
[ Quote ] [ Edit ] [ Delete ] 22#
现在这么早,你们就说资瓷,会不会给人一种内定啊,印点的感觉呢
dalao @ 2017-03-31 22:12:04
[ Quote ] [ Edit ] [ Delete ] 23#
%%%
Aleph @ 2017-04-01 11:13:16
[ Quote ] [ Edit ] [ Delete ] 24#
非常滋兹啊
其实 initializer list c++0x也可以用......
Aleph @ 2017-04-01 11:14:07
[ Quote ] [ Edit ] [ Delete ] 25#
顶顶,顶顶
xinbubawukong @ 2017-04-03 10:25:56
[ Quote ] [ Edit ] [ Delete ] 26#
我觉得吧,不管是c++11或是14甚至是17,只要不是98那中央都应该是资瓷的吧!
sdfzyhx @ 2017-04-03 15:33:08
[ Quote ] [ Edit ] [ Delete ] 27#
资瓷啊
jeffswt @ 2017-04-26 23:17:04
[ Quote ] [ Edit ] [ Delete ] 28#
C++17 会造成一些未定义的错误:

比如 a++ = b[++a] 是先执行左边还是先执行右边对结果有影响

C++14 之前先执行右边,C++17 之后先执行左边...

目测会挂掉很多代码~
stl @ 2017-04-27 14:08:19
[ Quote ] [ Edit ] [ Delete ] 29#
a++=b[++a]无论在哪个标准都非法吧
a++是右值
NiroBC @ 2017-04-28 07:32:25
[ Quote ] [ Edit ] [ Delete ] 30#
@stl
C++14及之前是未定义行为,完全看编译器实现者的心情
C++17将这个行为明确定义了
stl @ 2017-04-28 10:03:15
[ Quote ] [ Edit ] [ Delete ] 31#
@NiroBC
并不了解C++17……然而a++不再是右值了吗?还是说引入了新的概念?
SW_Wind @ 2017-04-28 16:22:32
[ Quote ] [ Edit ] [ Delete ] 32#
弱弱的问一句。。a++为毛能赋值啊
Edward_Tsui @ 2017-04-29 16:21:50
[ Quote ] [ Edit ] [ Delete ] 33#
那,干脆加上C++1y好了
150137 @ 2017-04-29 22:36:24
[ Quote ] [ Edit ] [ Delete ] 34#
思考一下……其实O2有的时候就会优化出一些比较奇怪的问题了

我们举个非常简单的例子来普及一下

看下面一段代码

#include <stdio.h>
int main() {
int a = 0;
for(int i=1;i<200000;++i) a += i;
printf("%d\n", a, a < 0);
}


不开O2的时候他得负一坨然后1,开了O2他得负一坨然后0,具体的原理是编译器编译的时候发现a最开始等于0,然后加了一坨正数,由于一份严谨的约数,所以他默认没有自然溢出这坨事,然后他大力把a < 0 直接优化成false

其实还有更玄妙的事情

#include <stdio.h>
int main() {
int a = -1;
for(int i=1;i<200000;++i) a += i;
while(a < 0) {
puts("wa");
}
printf("%d\n", a, a < 0);
}




#include <stdio.h>
int main() {
int a = -1;
for(int i=1;i<200000;++i) a += i;

printf("%d\n", a, a < 0);

while(a < 0) {
puts("wa");
}
}


这两份代码跑出来的结果是完全不同的,有兴趣的同学可以自己研究一下……

总结这种什么C++11之类的东西……应该作为一种单独的语言吧……直接一下子全都搞过去容易出现类似的事情
hunt_hunt @ 2017-05-19 11:35:00
[ Quote ] [ Edit ] [ Delete ] 35#
qaq
hothot @ 2017-05-19 18:04:04
[ Quote ] [ Edit ] [ Delete ] 36#
hothot
DCXDCX @ 2017-08-08 20:59:29
[ Quote ] [ Edit ] [ Delete ] 37#
笱莉郭嘉胜飼矣
EdvvardFrog @ 2017-08-10 10:26:24
[ Quote ] [ Edit ] [ Delete ] 38#
非常滋兹啊
EdvvardFrog @ 2017-08-10 10:26:27
[ Quote ] [ Edit ] [ Delete ] 39#
非常滋兹啊
EdvvardFrog @ 2017-08-10 10:26:30
[ Quote ] [ Edit ] [ Delete ] 40#
非常滋兹啊
grey @ 2017-08-16 09:27:04
[ Quote ] [ Edit ] [ Delete ] 41#
滋瓷 C++ 11,增加为语言吧
largecube233 @ 2017-08-16 17:59:47
[ Quote ] [ Edit ] [ Delete ] 42#
算了,bzoj能更新ui我吃屎
能添加c++11我也吃屎
骗人是蒟蒻
yzx_H2O @ 2018-02-12 21:33:40
[ Quote ] [ Edit ] [ Delete ] 43#
挖一波坟。。。。
WC2018已经开C++11了,下面就看bz怎么搞了。。
Cydiater @ 2018-02-13 10:14:08
[ Quote ] [ Edit ] [ Delete ] 44#
ccf 已经开 C++11 了,lss 该准备一下了
iloi @ 2018-02-13 14:12:31
[ Quote ] [ Edit ] [ Delete ] 45#
坐等@largecube233
你不加时限很容易翻车的。
建议你加个时限。
ycyzcf @ 2018-03-09 21:51:27
[ Quote ] [ Edit ] [ Delete ] 46#
为啥不开c++11啊。。。我这7天已经ce了几次了。。。
Timeless @ 2018-03-15 15:57:53
[ Quote ] [ Edit ] [ Delete ] 47#
zici啊
njust_acm @ 2018-05-13 23:30:32
[ Quote ] [ Edit ] [ Delete ] 48#
@root 求支持 c++14!!!!
njust_acm @ 2018-05-13 23:30:46
[ Quote ] [ Edit ] [ Delete ] 49#
编译器太老啦! :((
cnlarryzhong @ 2018-05-13 23:50:37
[ Quote ] [ Edit ] [ Delete ] 50#
有 c++11 就行了
[Top] [Previous Page] [Next Page]

HOME Back