제출 #977268

#제출 시각아이디문제언어결과실행 시간메모리
977268IUA_Hasin저울 (IOI15_scales)C++17
0 / 100
2 ms424 KiB
#include "scales.h" // #include <bits\stdc++.h> #include <vector> #include <assert.h> #include <stdio.h> #include <stdlib.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:31:24: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   31 |     ll c = getHeaviest(a, b, 2);
      |                        ^
scales.cpp:31:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   31 |     ll c = getHeaviest(a, b, 2);
      |                           ^
scales.cpp:33:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   33 |     w[5] = c;
      |            ^
scales.cpp:39:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   39 |             a4 = getHeaviest(b, 2, 3);
      |                              ^
scales.cpp:41:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   41 |             a4 = getHeaviest(b, 1, 3);
      |                              ^
scales.cpp:43:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   43 |             a4 = getHeaviest(b, 2, 3);
      |                              ^
scales.cpp:47:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   47 |             a4 = getHeaviest(a, 5, 6);
      |                              ^
scales.cpp:49:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   49 |             a4 = getHeaviest(a, 4, 6);
      |                              ^
scales.cpp:51:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   51 |             a4 = getHeaviest(a, 4, 5);
      |                              ^
scales.cpp:54:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   54 |     w[4] = a4;
      |            ^~
scales.cpp:66: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]
   66 |     ll a5 = getHeaviest(v[0], v[1], v[2]);
      |                                         ^
scales.cpp:66: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:66: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[2], 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[2], 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:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   71 |         a66 = getHeaviest(a5, v[2], v[3]);
      |                           ^~
scales.cpp:71: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]
   71 |         a66 = getHeaviest(a5, v[2], v[3]);
      |                                         ^
scales.cpp:71: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:73:27: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   73 |         a66 = getHeaviest(a5, v[1], v[3]);
      |                           ^~
scales.cpp:73: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]
   73 |         a66 = getHeaviest(a5, v[1], v[3]);
      |                                         ^
scales.cpp:73: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:75:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   75 |     w[3] = a66;
      |            ^~~
scales.cpp:84: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]
   84 |     ll a7 = getHeaviest(v1[0], v1[1], v1[2]);
      |                                            ^
scales.cpp:84: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:84: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: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]
   85 |     ll a8 = getLightest(v1[0], v1[1], v1[2]);
      |                                            ^
scales.cpp:85: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: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:89:20: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   89 |             w[2] = a7;
      |                    ^~
scales.cpp:91:20: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   91 |             w[0] = a8;
      |                    ^~
scales.cpp:93: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]
   93 |             w[1] = v1[i];
      |                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...