Submission #876937

# Submission time Handle Problem Language Result Execution time Memory
876937 2023-11-22T14:42:36 Z resfast Bulldozer (JOI17_bulldozer) C++17
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
#define islam_zymchybekov void solve()
#define ios ios::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr first
#define sc second
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define endl '\n'
#define nl cout<<'\n';
#define int long long
#define stg string
#define yes cout<<"Yes\n";
#define no cout<<"No\n";
typedef vector<int> vi;
typedef pair<int,int> pi;
void fopn(string name){
    freopen((name+".in").c_str(),"r",stdin);
    freopen((name+".out").c_str(),"w",stdout);
}
/*
talent is important,
as is the work we have to
do to achieve your goals... <Sorry, looks like I won't be able to go to the moon>©ciberpank

ok,enough quotes it's time to get to work
*/
struct V{
	int x1,y1,x2,y2;
	int ares(){
		return (abs(x2-x1))*(abs(y2-y1));
	}
};
int inter(V a,V b){
	int y = max(0ll,min(a.y2,b.y2)-max(a.y1,b.y1));
	int x = max(0ll,min(a.x2,b.x2)-max(a.x1,b.x1));
	return x*y;
}
int binpow(int a, int n){
    if(n == 0)
        return 1;
    if(n % 2 == 1)
        return binpow(a, n - 1) * a;
    else{
        int b = binpow(a, n / 2);
        return b * b;
    }
}

string s;
int a[1000000];
char ch[1002][1002];
int c,n,m,i,j,k,x,y,cnt=0,res=0,l=0,mx=-1000000,sum=0,nx=-1000000000;
islam_zymchybekov{
		cin>>n;
		for(i=0;i<n;i++){
			cin>>x>>x>>x;
			mx=max(x,mx);
			sum+=x;
			nx=max(nx,sum);
		}
		cout<<max(mx,nx);
 }
 main(){
    ios;
    int T = 1;
//	    cin >> T;
    while(T--){
        solve();
    }
}

Compilation message

bulldozer.cpp:67:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   67 |  main(){
      |  ^~~~
bulldozer.cpp: In function 'void fopn(std::string)':
bulldozer.cpp:21:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     freopen((name+".in").c_str(),"r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bulldozer.cpp:22:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     freopen((name+".out").c_str(),"w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -