codesolvediscuss | Unsorted

Telegram-канал codesolvediscuss - Codeforces solutions | CodeSolve | discussion

1582

Subscribe to a channel

Codeforces solutions | CodeSolve | discussion

int main() {
int t;
cin >> t;

while (t--) {
ll x, y, k;
cin >> x >> y >> k;
ll moves = 0 ;
ll cx = 0 , cy = 0 ;

while (cx < x || cy < y) {
if (moves % 2 == 0) {
cx += std::min(k, x - cx);
} else {
cy += std::min(k, y - cy);
}
moves++;
}
cout<<moves<<"\n";
}

return 0;
}

C

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Last case both are equal

Читать полностью…

Codeforces solutions | CodeSolve | discussion

what should we do for last Testcase

Читать полностью…

Codeforces solutions | CodeSolve | discussion

if anyone needs f, dm me

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Last testcase fail ho rha hai

Читать полностью…

Codeforces solutions | CodeSolve | discussion

ha bhai glt to kiya hai

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Bhai koi questions bhejdo bs please

Читать полностью…

Codeforces solutions | CodeSolve | discussion

@saurabh phele C to bhej

Читать полностью…

Codeforces solutions | CodeSolve | discussion

#include<bits/stdc++.h>
using namespace std;
#define int long long

int32_t main()
{
    int t;
    cin>>t;
   
    while(t--)
    {
       int n;
       cin>>n;
      
       vector<vector<char>>vec(n,vector<char>(4));
      
       for(int i=0;i<n;i++)
       {
           for(int j=0;j<4;j++)
           {
               cin>>vec[i][j];
           }
       }
      
       vector<int>ans;
      
       for(int i=n-1;i>=0;i--)
       {
           for(int j=0;j<4;j++)
           {
               if(vec[i][j]=='#')
               {
                   ans.push_back(j+1);
               }
           }
       }
      
       for(int i=0;i<ans.size();i++)
       {
           cout<<ans[i]<<" ";
       }
      
       cout<<endl;
    }
   
   
    return 0;
}

// B

Читать полностью…

Codeforces solutions | CodeSolve | discussion

There will be another case also right when minus 1 is done

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Yeh toh question mae bhi diya hai

Читать полностью…

Codeforces solutions | CodeSolve | discussion

I found the max of ceil x and ceil y and multiplied with 2

Читать полностью…

Codeforces solutions | CodeSolve | discussion

lol codeforces is too lag

Читать полностью…

Codeforces solutions | CodeSolve | discussion

BBBB

void test()
{
int n;
cin >> n;

vector<string> v1(n);


for (int i = 0; i < n; ++i) {
cin >> v1[i];
}


for (int i = n - 1; i >= 0; --i) {

for (int j = 0; j < 4; ++j) {
if (v1[i][j] == '#') {

cout << (j + 1) <<" ";
break;
}
}
}

cout<<endl;
}

Читать полностью…

Codeforces solutions | CodeSolve | discussion

codeforces lag too much

Читать полностью…

Codeforces solutions | CodeSolve | discussion

if (jj_x == jj_y &&(x % k == 0 || y % k == 0)) { count11--; }
cout << count11 <<"\n";

Читать полностью…

Codeforces solutions | CodeSolve | discussion

I think if both are equal than we will do max of both moves -1

Читать полностью…

Codeforces solutions | CodeSolve | discussion

bio wala bnda kha gya bhai

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Hmm c ka edge case kya h??

Читать полностью…

Codeforces solutions | CodeSolve | discussion

C mae edge case samajh nhi aa rha

Читать полностью…

Codeforces solutions | CodeSolve | discussion

kuch to galat kia hai bhai

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Questions please send not answers

Читать полностью…

Codeforces solutions | CodeSolve | discussion

C ka logic btao yaar koi

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Are u taking ceil value of x\k

Читать полностью…

Codeforces solutions | CodeSolve | discussion

par isme last tc fail ho ra

Читать полностью…

Codeforces solutions | CodeSolve | discussion

calculate the minimum moves on required, X axis and Y axis, and then sum of total number of most in the maximum of X and Y axis

Читать полностью…

Codeforces solutions | CodeSolve | discussion

i can't even submit my code

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Pleaseeeeeeeeeeeeeee

Читать полностью…

Codeforces solutions | CodeSolve | discussion

#include <iostream>
using namespace std;

int main() {
int t;
cin >> t;

while (t--) {
int a, b;
cin >> a >> b;

int fck = b - a;
cout << fck << endl;
}

return 0;
}

Читать полностью…

Codeforces solutions | CodeSolve | discussion

Join @iscodefun for todays DIV4

Читать полностью…
Subscribe to a channel