当前位置:网站首页>P2788 math 1 - addition and subtraction
P2788 math 1 - addition and subtraction
2022-07-07 10:32:00 【A program ape who beats the keyboard violently】
P2788 mathematics 1(math1)- Addition and subtraction formula
# mathematics 1(math1)- Addition and subtraction formula
## Background
Konnyaku HansBug In the math exam room , Scratched my head countless times , But my mind is still blank .
## Title Description
It's not easy ,HansBug Finally, it's time to do the last math problem , There is a mess of addition and subtraction . Obviously, success is at hand . But his brain cells and RP It has been exhausted , So this important task is up to you .
## Input format
a line , Contains an addition and subtraction polynomial in the form of a string ( Each number ranges from 0-32767).
## Output format
An integer , For the calculated results ( Ensure that the calculation result does not exceed the long integer range ).
## Examples #1
### The sample input #1
```
1+2-3
```
### Sample output #1
```
0
```
## Tips
The string length does not exceed 60000
【 Ideas 】
python2.
【40 Code division 】
#include<stdio.h>
#include<iostream>
using namespace std;
void fwrite(int n)
{
if(n>9)fwrite(n/10);
putchar(n%10+'0');
}
int ans,n;
signed main()
{
while(scanf("%d",&n)!=EOF)ans+=n;
fwrite(ans);
return 0;
}
【CE Code 】
print(input())
Forgot to tune the language .
【AC Code 】
print(input())
Accelerating artifact locomotive
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
# mathematics 1(math1)- Addition and subtraction formula
## Background
Konnyaku HansBug In the math exam room , Scratched my head countless times , But my mind is still blank .
## Title Description
It's not easy ,HansBug Finally, it's time to do the last math problem , There is a mess of addition and subtraction . Obviously, success is at hand . But his brain cells and RP It has been exhausted , So this important task is up to you .
## Input format
a line , Contains an addition and subtraction polynomial in the form of a string ( Each number ranges from 0-32767).
## Output format
An integer , For the calculated results ( Ensure that the calculation result does not exceed the long integer range ).
## Examples #1
### The sample input #1
```
1+2-3
```
### Sample output #1
```
0
```
## Tips
The string length does not exceed 60000
【 Ideas 】
python2.
【40 Code division 】
#include<stdio.h>
#include<iostream>
using namespace std;
void fwrite(int n)
{
if(n>9)fwrite(n/10);
putchar(n%10+'0');
}
int ans,n;
signed main()
{
while(scanf("%d",&n)!=EOF)ans+=n;
fwrite(ans);
return 0;
}
【CE Code 】
print(input())
Forgot to tune the language .
【AC Code 】
print(input())
Accelerating artifact locomotive
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
边栏推荐
- 成为优秀的TS体操高手 之 TS 类型体操前置知识储备
- IIC基本知识
- JS实现链式调用
- The mobile terminal automatically adjusts the page content and font size by setting rem
- leetcode-303:区域和检索 - 数组不可变
- OpenGL glLightfv 函数的应用以及光源的相关知识
- JMeter about setting thread group and time
- Some superficial understanding of word2vec
- Easyexcel read write simple to use
- 1324: [example 6.6] integer interval
猜你喜欢
1321: [example 6.3] deletion problem (noip1994)
ThreadLocal is not enough
XML configuration file parsing and modeling
Leetcode-560: subarray with sum K
mysql插入数据创建触发器填充uuid字段值
南航 PA3.1
P1031 [noip2002 improvement group] average Solitaire
JMeter loop controller and CSV data file settings are used together
[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet
Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!
随机推荐
[detailed explanation of Huawei machine test] tall and short people queue up
Easyexcel read write simple to use
软考中级,软件设计师考试那些内容,考试大纲什么的?
[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet
HDU-2196 树形DP学习笔记
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
[牛客网刷题 Day5] JZ77 按之字形顺序打印二叉树
Common shortcut keys in IDA
Factorial implementation of large integer classes
Schnuka: working principle of robot visual grasping machine visual grasping
使用Tansformer分割三维腹部多器官--UNETR实战
[email protected]能帮助我们快速拿到日志对象
1321: [example 6.3] deletion problem (noip1994)
A small problem of bit field and symbol expansion
. Net configuration system
php \n 换行无法输出
BigDecimal value comparison
Kotlin实现微信界面切换(Fragment练习)
2022.7.5DAY597
@Transcation的配置,使用,原理注意事项: