제출 #1077396

#제출 시각아이디문제언어결과실행 시간메모리
1077396Trumling저울 (IOI15_scales)C++14
0 / 100
1 ms436 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second #define pb push_back #define INF 99999999999999 #define all(x) x.begin(),x.end() typedef long long ll; ll n=6; void init(int T) { /* ... */ return ; } void orderCoins() { /* ... */ int ans[6]; ll arr[2][3]; arr[0][1]=getMedian(1,2,3); arr[0][0]=getLightest(1,2,3); arr[0][2]= 6 - (arr[0][0] + arr[0][1]); arr[1][1]=getMedian(4,5,6); arr[1][0]=getLightest(4,5,6); arr[1][2]= 15 - (arr[1][0] + arr[1][1]); ll mid=getMedian(arr[0][2],arr[1][1],arr[1][2]); if(mid==arr[1][1]) { ans[0]=arr[0][0]; ans[1]=arr[0][1]; ans[2]=arr[0][2]; ans[3]=arr[1][0]; ans[4]=arr[1][1]; ans[5]=arr[1][2]; ll place=getNextLightest(ans[0],ans[1],ans[2],ans[3]); if(place==ans[0]) { place=getMedian(ans[3],ans[0],ans[1]); if(place==ans[0]) for(int i=2;i>=0;i--) swap(ans[i],ans[i+1]); } else for(int i=2;i>=0;i--) { swap(ans[i],ans[i+1]); if(ans[i+1]==place) break; } answer(ans); return ; } ans[0]=arr[0][0]; ans[1]=arr[0][1]; ans[2]=arr[1][0]; ans[3]=arr[1][1]; ans[4]=arr[1][2]; ans[5]=arr[0][2]; if(mid==arr[0][2]) swap(ans[4],ans[5]); mid=getMedian(ans[1],ans[2],ans[3]); if(mid==ans[1]) { swap(ans[1],ans[2]); mid=getLightest(ans[0],ans[1],ans[2]); if(mid==ans[1]) swap(ans[0],ans[1]); } else if(mid==ans[3]) { swap(ans[1],ans[2]); swap(ans[2],ans[3]); mid=getMedian(ans[0],ans[1],ans[2]); if(mid==ans[2]) { swap(ans[0],ans[1]); swap(ans[1],ans[2]); } else if(mid==ans[0]) { swap(ans[0],ans[1]); } } answer(ans); return ; }

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

scales.cpp: In function 'void init(int)':
scales.cpp:13:15: warning: unused parameter 'T' [-Wunused-parameter]
   13 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:32:30: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   32 |     ll mid=getMedian(arr[0][2],arr[1][1],arr[1][2]);
      |                      ~~~~~~~~^
scales.cpp:32:40: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   32 |     ll mid=getMedian(arr[0][2],arr[1][1],arr[1][2]);
      |                                ~~~~~~~~^
scales.cpp:32:50: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   32 |     ll mid=getMedian(arr[0][2],arr[1][1],arr[1][2]);
      |                                          ~~~~~~~~^
scales.cpp:36:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   36 |         ans[0]=arr[0][0];
      |                ~~~~~~~~^
scales.cpp:37:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   37 |         ans[1]=arr[0][1];
      |                ~~~~~~~~^
scales.cpp:38:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   38 |         ans[2]=arr[0][2];
      |                ~~~~~~~~^
scales.cpp:39:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   39 |         ans[3]=arr[1][0];
      |                ~~~~~~~~^
scales.cpp:40:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   40 |         ans[4]=arr[1][1];
      |                ~~~~~~~~^
scales.cpp:41:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   41 |         ans[5]=arr[1][2];
      |                ~~~~~~~~^
scales.cpp:66:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   66 |         ans[0]=arr[0][0];
      |                ~~~~~~~~^
scales.cpp:67:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   67 |         ans[1]=arr[0][1];
      |                ~~~~~~~~^
scales.cpp:68:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   68 |         ans[2]=arr[1][0];
      |                ~~~~~~~~^
scales.cpp:69:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   69 |         ans[3]=arr[1][1];
      |                ~~~~~~~~^
scales.cpp:71:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   71 |         ans[4]=arr[1][2];
      |                ~~~~~~~~^
scales.cpp:72:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   72 |         ans[5]=arr[0][2];
      |                ~~~~~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...