QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#672997 | #5038. City | Gourab_Biswas# | WA | 0ms | 3688kb | C++20 | 2.4kb | 2024-10-24 20:13:56 | 2024-10-24 20:13:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef tree<
ll,
null_type,
less_equal<ll>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define db double
#define pii pair<ll,ll>
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b,c) for(ll i=a;i<b;i+=c)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define fri(i,a,b,c) for(ll i=a;i>=b;i-=c)
#define pb push_back
#define ss second
#define ff first
#define in insert
#define sq(x) (x*x)
#define all(a) a.begin(),a.end()
#define nl '\n'
#define npii pair<ll,pair<ll,ll>>
#define mnpq priority_queue <npii, vector<npii>, greater<npii> >
ll gcd(ll a,ll b){
if(b==0)return a;
return gcd(b,a%b);
}
int getRandom(int L,int R)
{
return rng()%(R-L+1) + L;
}
ll lcm(ll a,ll b){
return ((a)/gcd(a,b))*b;
}
ll bigmod(ll a,ll n,ll md){
if(n==0){
return 1;
}
if(n==1){
return a%md;
}
ll d= bigmod(a,n/2,md);
if(n%2==0){
return (d*d)%md;
}
else{
return ( ((d*d)%md) * (a%md) )%md;
}
}
bool sortbysec(const pair<int,int> &a,
const pair<int,int> &b)
{
if(a.first==b.first){
return (a.second > b.second);
}
return (a.first< b.first);
}
const ll N = 200004;
const ll mod = 1e9 + 7;
const ll neginf= -1e18;
const ll inf = 1e18;
const ld eps= 1e-9;
/// avoid Wrong answer
/// think 2 minute before submission
/// check input output before submission
///use binary search for maximum minimum problem
ll sqr(ll d){
return d*d;
}
void solve(){
ll n,m;
cin>>n>>m;
n++;
m++;
ll an=0;
f(i,0,n){
f(j,0,m){
//right
ll rt=n-1-i;
ll dw=m-1-j;
ll dig_dw=min(rt,dw);
ll dig_up=min(i,dw);
an+=(rt/2)+(dw/2)+(dig_dw/2)+(dig_up/2);
}
}
cout<<an;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t=1;
// cin>>t;
while(t--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3688kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
2 3
output:
14
result:
ok 1 number(s): "14"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3612kb
input:
252 139
output:
5431370
result:
wrong answer 1st numbers differ - expected: '156806790', found: '5431370'