제출 #918657

#제출 시각아이디문제언어결과실행 시간메모리
918657Sputnik123Coins (IOI17_coins)C++14
100 / 100
7 ms1948 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <functional>
#include <cstdio>
#define pb push_back
#define in insert
#define pll pair<ll,ll>
#define vpl vector<pll>
#define vll vector <ll>
#define vl vector<ll>
///#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define endl "\n"
#define ll long long
#define ull unsigned long long
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt,fma")
const ll sz=150;
const ll inf=1e12+7;
const ll mod=1e9+7;
const ll P=47;
const double e=1e-6;
ll gcd(ll x,ll y)
{
    return (y ? gcd(y,x%y) : x);
}
ll lcm(ll x,ll y)
{
    return (x/gcd(x,y))*y;
}
ll binpow(ll a,ll b)
{
    ll ans=1;
    a%=mod;
    while(b)
    {
        ans=(b&1 ? (ans*a)%mod : ans);
        a=(a*a)%mod;
        b>>=1;
    }
    return ans;
}
ll modm(ll n,ll m,ll md=mod)
{
    if(!m)  return 1;
    ll res=modm(n,m>>1,md);
    if(m&1) return res*res%md*n%md;
    return res*res%md;
}
/**************************/
#include "coins.h"
#include <bits/stdc++.h>
#define ll int 
using namespace std;
int col[150],per[150];
vector <int> coin_flips(vector <int> b, int c)
{
    ll x=0,i,j;
    for(ll i=0;i<64;i++)
    {
        if(b[i])
        {
            x^=i;
        }
    }
    x^=c;
    vector <int> flips(1);
    flips[0]=x;
    return flips;
}
int find_coin (vector <int> b)
{
    ll x=0,i;
    for(ll i=0;i<64;i++)
    {
        if(b[i])
        {
            x^=i;
        }
    }
    return x;
}

컴파일 시 표준 에러 (stderr) 메시지

coins.cpp:62: warning: "ll" redefined
   62 | #define ll int
      | 
coins.cpp:21: note: this is the location of the previous definition
   21 | #define ll long long
      | 
coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:67:12: warning: unused variable 'i' [-Wunused-variable]
   67 |     ll x=0,i,j;
      |            ^
coins.cpp:67:14: warning: unused variable 'j' [-Wunused-variable]
   67 |     ll x=0,i,j;
      |              ^
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:82:12: warning: unused variable 'i' [-Wunused-variable]
   82 |     ll x=0,i;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...