当前位置:网站首页>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")边栏推荐
- ArrayList thread insecurity and Solutions
- @Configuration, use, principle and precautions of transmission:
- 原型与原型链
- [email protected]能帮助我们快速拿到日志对象
- [detailed explanation of Huawei machine test] tall and short people queue up
- MySQL insert data create trigger fill UUID field value
- Leetcode-560: subarray with sum K
- P1031 [noip2002 improvement group] average Solitaire
- 施努卡:机器视觉定位技术 机器视觉定位原理
- 深入理解Apache Hudi异步索引机制
猜你喜欢

1324:【例6.6】整数区间

Encrypt and decrypt stored procedures (SQL 2008/sql 2012)

Use the fetch statement to obtain the repetition of the last row of cursor data

The Hal library is configured with a general timer Tim to trigger ADC sampling, and then DMA is moved to the memory space.

求最大公约数与最小公倍数(C语言)

2022年上半年5月网络工程师试题及答案

openinstall与虎扑达成合作,挖掘体育文化产业数据价值

leetcode-560:和为 K 的子数组

CAS mechanism

Talking about the return format in the log, encapsulation format handling, exception handling
随机推荐
Study summary of postgraduate entrance examination in November
基于HPC场景的集群任务调度系统LSF/SGE/Slurm/PBS
Gym installation pit records
[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
01 use function to approximate cosine function (15 points)
How embedded engineers improve work efficiency
The variables or functions declared in the header file cannot be recognized after importing other people's projects and adding the header file
leetcode-560:和为 K 的子数组
IO model review
[email protected]能帮助我们快速拿到日志对象
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
Multithreaded asynchronous orchestration
Kotlin realizes wechat interface switching (fragment exercise)
Prototype and prototype chain
The mobile terminal automatically adjusts the page content and font size by setting rem
CAS mechanism
Study summary of postgraduate entrance examination in October
打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?
Study summary of postgraduate entrance examination in August