当前位置:网站首页>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")
边栏推荐
- Some properties of leetcode139 Yang Hui triangle
- IO model review
- Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
- [sword finger offer] 42 Stack push in and pop-up sequence
- [STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
- 2022.7.4DAY596
- BigDecimal value comparison
- I'd rather say simple problems a hundred times than do complex problems once
- Adb 实用命令(网络包、日志、调优相关)
- 路由器开发知识汇总
猜你喜欢
随机推荐
leetcode-304:二维区域和检索 - 矩阵不可变
P1031 [noip2002 improvement group] average Solitaire
Schnuka: machine vision positioning technology machine vision positioning principle
2022.7.6DAY598
CAS mechanism
[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet
根据设备信息进行页面跳转至移动端页面或者PC端页面
【HigherHRNet】 HigherHRNet 详解之 HigherHRNet的热图回归代码
【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
Basic introduction of yarn and job submission process
IPv4 socket address structure
【acwing】786. Number k
2022年上半年5月网络工程师试题及答案
High number_ Chapter 1 space analytic geometry and vector algebra_ Quantity product of vectors
The variables or functions declared in the header file cannot be recognized after importing other people's projects and adding the header file
[daiy5] jz77 print binary tree in zigzag order
1321: [example 6.3] deletion problem (noip1994)
Multisim -- software related skills
Remote meter reading, switching on and off operation command
A small problem of bit field and symbol expansion