# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
120490 |
2019-06-24T16:39:40 Z |
_Samir |
CATS (NOI14_cats) |
C++14 |
|
188 ms |
6344 KB |
//https://github.com/mostafa-saad/MyCompetitiveProgramming/blob/master/Olympiad/MCO/official/2016/editorial.pdf
#include<queue>
#include<map>
#include <string>
#include<bits/stdc++.h>
#define pi 3.141592654
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define input ios_base::sync_with_stdio(0);cin.tie(0);
//#define x real()
//#define y imag()
using namespace std;
typedef pair<double,double>pdd;
typedef long long ll;
typedef pair<ll, ll>pii;
//typedef complex<double> point;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<30> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//#define var(x) ((x)<<1)
//#define nvar(x) ((x)^1)
const int N=100000,M=100000;
ll n,x,l,q;
main()
{
//cout<<Pow((ll)1000000,(ll)110);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
// char input[15];
// scanf("%s", &input); array of char
// gets(c+1); array of char
//printf("%s, ",name[k[i]].c_str()); printf of string
//priority_queue<ll,vector<ll>,greater<ll>>y;
input;
cin>>q;
while(q--)
{
cin>>x>>l>>n;
n*=2;
ll g=(l+n-1)/n;
g=g*n;
if(((x+1)/2)%2)
{
if(x%2)cout<<g<<endl;
else cout<<g+1<<endl;
}
else
{
if(x%2)cout<<g+1<<endl;
else cout<<g<<endl;
}
}
return 0;
}
Compilation message
cats.cpp:27:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
19 ms |
640 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
188 ms |
6344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |