제출 #977273

#제출 시각아이디문제언어결과실행 시간메모리
977273IUA_Hasin저울 (IOI15_scales)C++17
0 / 100
1 ms500 KiB
#include "scales.h" #include <bits/stdc++.h> #define endl "\n" #define ll long long ll t; ll vis1[7]; ll vis2[7]; void init(int T) { t = T; } void orderCoins() { for(int i=0; i<7; i++){ vis1[i] = 0; vis2[i] = 0; } int w[6]; ll a = getHeaviest(1, 2, 3); ll b = getHeaviest(4, 5, 6); ll c = getHeaviest(a, b, 2); w[5] = c; vis2[c] = 1; ll a4; if(c==a){ if(a==1){ a4 = getHeaviest(b, 2, 3); } else if(a==2){ a4 = getHeaviest(b, 1, 3); } else { a4 = getHeaviest(b, 2, 3); } } else { if(b==4){ a4 = getHeaviest(a, 5, 6); } else if(b==5){ a4 = getHeaviest(a, 4, 6); } else { a4 = getHeaviest(a, 4, 5); } } w[4] = a4; vis2[a4] = 1; // cout << c << " " << a4 << endl; std::vector<ll> v; for(int i=1; i<=6; i++){ if(vis2[i]==0){ v.push_back(i); } } ll a5 = getHeaviest(v[0], v[1], v[2]); ll a66; if(a5==v[0]){ a66 = getHeaviest(a5, v[2], v[3]); } else if(a5==v[1]){ a66 = getHeaviest(a5, v[2], v[3]); } else { a66 = getHeaviest(a5, v[1], v[3]); } w[3] = a66; vis2[a66] = 1; std::vector<ll> v1; for(int i=1; i<=6; i++){ if(vis2[i]==0){ v1.push_back(i); } } ll a7 = getHeaviest(v1[0], v1[1], v1[2]); ll a8 = getLightest(v1[0], v1[1], v1[2]); for(int i=0; i<3; i++){ if(v1[i]==a7){ w[2] = a7; } else if(v1[i]==a8){ w[0] = a8; } else { w[1] = v1[i]; } } answer(w); }

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

scales.cpp: In function 'void orderCoins()':
scales.cpp:27:24: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   27 |     ll c = getHeaviest(a, b, 2);
      |                        ^
scales.cpp:27:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   27 |     ll c = getHeaviest(a, b, 2);
      |                           ^
scales.cpp:29:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   29 |     w[5] = c;
      |            ^
scales.cpp:35:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   35 |             a4 = getHeaviest(b, 2, 3);
      |                              ^
scales.cpp:37:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   37 |             a4 = getHeaviest(b, 1, 3);
      |                              ^
scales.cpp:39:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   39 |             a4 = getHeaviest(b, 2, 3);
      |                              ^
scales.cpp:43:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   43 |             a4 = getHeaviest(a, 5, 6);
      |                              ^
scales.cpp:45:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   45 |             a4 = getHeaviest(a, 4, 6);
      |                              ^
scales.cpp:47:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   47 |             a4 = getHeaviest(a, 4, 5);
      |                              ^
scales.cpp:50:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   50 |     w[4] = a4;
      |            ^~
scales.cpp:62:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   62 |     ll a5 = getHeaviest(v[0], v[1], v[2]);
      |                                         ^
scales.cpp:62:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:62:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:65:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   65 |         a66 = getHeaviest(a5, v[2], v[3]);
      |                           ^~
scales.cpp:65:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   65 |         a66 = getHeaviest(a5, v[2], v[3]);
      |                                         ^
scales.cpp:65:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:67:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   67 |         a66 = getHeaviest(a5, v[2], v[3]);
      |                           ^~
scales.cpp:67:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   67 |         a66 = getHeaviest(a5, v[2], v[3]);
      |                                         ^
scales.cpp:67:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:69:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   69 |         a66 = getHeaviest(a5, v[1], v[3]);
      |                           ^~
scales.cpp:69:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   69 |         a66 = getHeaviest(a5, v[1], v[3]);
      |                                         ^
scales.cpp:69:41: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:71:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   71 |     w[3] = a66;
      |            ^~~
scales.cpp:80:44: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   80 |     ll a7 = getHeaviest(v1[0], v1[1], v1[2]);
      |                                            ^
scales.cpp:80:44: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:80:44: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:81:44: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   81 |     ll a8 = getLightest(v1[0], v1[1], v1[2]);
      |                                            ^
scales.cpp:81:44: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:81:44: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
scales.cpp:85:20: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   85 |             w[2] = a7;
      |                    ^~
scales.cpp:87:20: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   87 |             w[0] = a8;
      |                    ^~
scales.cpp:89:24: warning: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to 'int' may change value [-Wconversion]
   89 |             w[1] = v1[i];
      |                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...